Opened 5 years ago

Closed 5 years ago

#18169 closed defect (invalid)

dGrid is fetching last row of the page no matter which row I select

Reported by: rahul.sharma Owned by:
Priority: undecided Milestone: 1.11
Component: General Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

Hi ,

I am using dGrid and setting a store to that , but I have observed that regardless of selection it is always fetching the last row of the page.

IMP : I have read the similar issues and tried to use idProperty to manually specify the unique ID but that did not help.

Code Snippet :

var grid = new (declare([OnDemandGrid?, Pagination,DijitRegistry?,selector,Selection]))({

store:storetest,

className: "dgrid-autoheight", loadingMessage: "Loading data...", escapeHTMLInData: 'false', selectionMode: "single", noDataMessage: "No results found...",

columns: [

Select = selector({}), { field: "ordId", label: "Order ID", formatter:gridFormatter},

{ field: "product", label: "product" }, { field: "price", label: "price"}, { field: "make", label: "make"}

]

}, "dorderSearchGrid");

grid.startup();

Fetching the row data on selection: grid.on(".dgrid-row:click",function(evnt){

var row=grid.row(evnt); gridSelection = row.data;

});

Setting the store :

var storetest = new Observable(new Memory({data:dojojson.fromJson(result),idProperty: "ordId"})); dijit.byId('dorderSearchGrid').set('store',storetest);

Here ordId is unique

================================================================

The JSON "result" I am passing in above "data:" property is coming like this :

{"items":[{"ordId":"123","product":"product1","price":20,"make":"company1"}, {"ordId":"456","product":"product2","price":10,"make":"company2"},{...}]}

Please suggest how to get it work.

Change History (1)

comment:1 Changed 5 years ago by dylan

Milestone: tbd1.11
Resolution: invalid
Status: newclosed

This is the general Dojo bug tracking system, not the mailing list. You should start with questions like these through the relevant support forums, https://github.com/SitePen/dgrid#getting-support . If it is then determined that there is a bug, you should then file a bug (in this case, if there is a bug, you would file it against dgrid, rather than the general Dojo system).

Please help us out by using the right place for questions, so that our bug tracking systems don't get filled with issues that shouldn't be in them. Thanks!

Note: See TracTickets for help on using tickets.