Select to view content in your preferred language

dojo Data grid not display data

2419
1
04-15-2015 02:26 AM
NadirHussain
Frequent Contributor

HTML CODE

<table data-dojo-type="dojox.grid.DataGrid"  id="grid" selectionMode="none" style="height:96%;width:96%;margin:5px; border:4px solid black;">

                                         <thead>

                                            <tr>

                                                <th field="ObjectID"  width="50px">

                                                    <img alt="+" src="Images/nav_zoomin1.png"/>

                                                </th>

                                                <th field="SIREN_NO" width="100px">Siren Number</th>

                                                <th field="Reg_E" width="200px">Region English</th>

                                            </tr>

                                        </thead>

  </table>

JAVA SCRIPT CODE

function executeQueryTask(strRegionName, strCityName, intCondition) {

                   var items = []; //all items to be stored in data store

                   var featureAttributes;

                   var inti = 0;

                   var queryTask = new esri.tasks.QueryTask("http://dell-pc/ArcGIS/rest/services/SirenFeatureService/MapServer/3");

                   var query = new esri.tasks.Query();

                   query.returnGeometry = true;

                   query.outFields = ["SIREN_NO", "Reg_E", "ObjectID"];

                   if (intCondition == 0)

                     query.where = "1=1";

                  else if (intCondition == 1)

                     query.where = "Reg_A=" + strRegionName + "  " + "And" + "   " + "City_A=" + strCityName;

                     queryTask.execute(query, function (results) {

                      for (var i =0; i < results.features.length; i++) {

                         featureAttributes = results.features.attributes;

                         items.push(featureAttributes);

                         }

                         var memStore = new Memory({data: items,idProperty: "ObjectID"});

                     window.grid.set("store", memStore);

                     window.grid.set("sort", "Reg_A");

                      });

                }

i have check my code works and fullfill items array.but i think the problem starts from the red lines.please help why grid is not showing data.thanks for help

0 Kudos
1 Reply
YousefQuran
Frequent Contributor

                                                                           بسم الله الرحمن الرحيم

Dear Nadir,
The problem is not clear, but I think it is better to use dgrid in this way. It will handle data easily but you have to make sure about passing fields because it is case sensitive and do not change the "id" column name because the theme will not works fine.

I wish this help,
Regards.

0 Kudos