Login Register

ComboBox with dojo.data.ItemFileReadStore doesn't work on IE7

Hello, I've got this nasty problem... I've this combobox:

<!-- oggetti data -->
                <div dojoType="dojo.data.ItemFileReadStore" jsId="dataOperatori"
              url="jazzFunzioni.php?action=operatori">
</div>
                <!-- Form di accesso -->
               
                <div id="DialogDiAccesso" dojoType="dijit.Dialog" onCancel="main" title="Accesso a Jazz" draggable="false">
                        <form id="FormDiAccesso" dojoType="dijit.form.Form">
                               
                                        Operatore:<input name="comboOperatore" id="operatore"
                dojoType="dijit.form.ComboBox"
                                store="dataOperatori"
                                searchAttr="name"
                autocomplete="false">

                        
                               
                                Parola chiave:<input dojoType="dijit.form.TextBox" type="password" id="password">
                                <p align="right">
                                        <button dojoType="dijit.form.Button" onClick="loginOkClick();">Entra</button>                        
                               
                        </form>
                </div>

Everything works perfectly on firefox and chrome. But not on IE7, giving an error stating dojo.data.ItemFileReadStore: Invalid Item argument.

The JSON line that the php returns is:

{items:[{name: "adriano"},{name: "agostino"},{name: "daniela"},{name: "donatella"},{name: "fabio"},{name: "flavio"},{name: "giulia"},{name: "halley"},{name: "lucio"},{name: "marco"},{name: "mauro"},{name: "paolo"}]}

I really don't get the problem... it was working so fine... :((((

-dario.

Are you using the PHP

Are you using the PHP function "json_encode"? Try this for the JSON. Double Quotes.

{"identifier":"name","items":[{"name": "adriano"},{"name": "agostino"},{"name": "daniela"},{"name": "donatella"},{"name": "fabio"},{"name": "flavio"},{"name": "giulia"},{"name": "halley"},{"name": "lucio"},{"name": "marco"},{"name": "mauro"},{"name": "paolo"}]}

same problem

The problem is that it does not charge anything from php and whether from txt

div dojoType="dojo.data.ItemFileReadStore" jsId="stateStore" url="carga_datos.php">

input dojoType="dijit.form.FilteringSelect"
store="stateStore"
searchAttr="name"
name="state1"
autocomplete="true"

And what PHP is returned:

{"identifier":"abbreviation","items":[{"name":"CHICLAYO","label":"CHICLAYO","abbreviation":"00"},{"name":"CHICLAYO","label":"CHICLAYO","abbreviation":"01"},{"name":"CHONGOYAPE","label":"CHONGOYAPE","abbreviation":"02"},{"name":"PATAPO","label":"PATAPO","abbreviation":"17"},{"name":"POMALCA","label":"POMALCA","abbreviation":"18"},{"name":"PUCALA","label":"PUCALA","abbreviation":"19"},{"name":"TUMAN","label":"TUMAN","abbreviation":"20"}]}

But if you said to a TXT if it works .....

Thanks for the help

same problem

And what PHP is returned:

{"identifier":"abbreviation","items":[{"name":"CHICLAYO","label":"CHICLAYO","abbreviation":"00"},{"name":"CHICLAYO","label":"CHICLAYO","abbreviation":"01"},{"name":"CHONGOYAPE","label":"CHONGOYAPE","abbreviation":"02"},{"name":"ETEN","label":"ETEN","abbreviation":"03"},{"name":"ETEN PUERTO","label":"ETEN PUERTO","abbreviation":"04"},{"name":"JOSE LEONARDO ORTIZ","label":"JOSE LEONARDO ORTIZ","abbreviation":"05"},{"name":"LA VICTORIA","label":"LA VICTORIA","abbreviation":"06"},{"name":"LAGUNAS","label":"LAGUNAS","abbreviation":"07"},{"name":"MONSEFU","label":"MONSEFU","abbreviation":"08"},{"name":"NUEVA ARICA","label":"NUEVA ARICA","abbreviation":"09"},{"name":"OYOTUN","label":"OYOTUN","abbreviation":"10"},{"name":"PICSI","label":"PICSI","abbreviation":"11"},{"name":"PIMENTEL","label":"PIMENTEL","abbreviation":"12"},{"name":"REQUE","label":"REQUE","abbreviation":"13"},{"name":"SANTA ROSA","label":"SANTA ROSA","abbreviation":"14"},{"name":"SA\u00a5A","label":"SA\u00a5A","abbreviation":"15"},{"name":"CAYALTI","label":"CAYALTI","abbreviation":"16"},{"name":"PATAPO","label":"PATAPO","abbreviation":"17"},{"name":"POMALCA","label":"POMALCA","abbreviation":"18"},{"name":"PUCALA","label":"PUCALA","abbreviation":"19"},{"name":"TUMAN","label":"TUMAN","abbreviation":"20"}]}

But if you said to a TXT if it works .....

The issue is that it does not leave anything in the combo ... and when you change a url:file.txt ... if it works

Thanks for the help

trailing comma?

Maybe your JSON has an (invalid) trailing comma, like {foo: 1, bar: 2, } ?

=========
Bill Keese
Project Lead (aka BDFL) of Dijit

Same issue with loading a grid

Try with this...

I've tried with this header on php script and it's works on IE7 :

header('Content-Type: application/json; charset=utf-8');