I am using a ListGrid to display records from RestDataSource.
I cannot however change type of making selection on this ListGrid. The only behaviour - no matter what selectionType is selected - is following:
clicking on an unselected record selects it and gives it focus
clicking on a selected record does not unselect that row, but only give it focus
pressing key up/down moves focus and select next/previuos row
the only way of unselecting a row is to click on it with Ctrl pressed
I have noticed that changing RestDataSource to local data fixes this and selection works ok.
How to change my code to have ListGrid behave like in “single” mode.
The problem from my previous post and another one that I have found recently and was connected with number of rows in ListGrid was caused by incorrect parameters totalRows, startRow and endRow, that I was returning from PHP.
All those parameters were passed to PHP json_encode function as strings and was also encoded as strings. Unfortunately for SmartClient DataSource those values were needed as int and it was not doing parseInt(totalRows),…
After putting implicit cast to int in my PHP code everything started do work as it should.
I tripped over this also, early on in my SmartClient development. One of those things you learn along the way. I’m not quite sure why SmartClient cares, since as I recall, if you look in the JSON the only difference is having totalRows quoted vs. unquoted. Perhaps this will get fixed in an upcoming release.
The issue with startRow, endRow and totalRows on the dsResponse not being handled correctly if they are strings (vs integers) has been fixed for SmartClient 6.1.