You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello and congrats for this little gem.
I'm creating a real-time web app which should update the cells upon a socket notification. Everything works fine, but I had to dig into your code to get around of a problem. Here is my code:
if (item) {
var row = $("#elem_").jsGrid("_rowByItem", item);
if (row.length) {
$("#elem_").jsGrid("updateItem", row, msg.body);
}
}
NOTE: "item" is the reference of the record involved.
The recordset counts 100 rows, but the grid pages at blocks of 15. Now, when a notification hits a rows which is off the current page (highly probable), I must know in advance whether to update the cell or not. If I don't do it, the grid throws an exception.
For this reason, I suggest to expose (I mean publicly document) the "_rowByItem" method, which helped me.
The text was updated successfully, but these errors were encountered:
populate the grid with 100 records/rows, for instance;
configure the grid to paginate the set by a size of 10;
The grid shows the records and works as a charm.
Now suppose that some event/notification/whatever wants to update a field of a certain record. You'll face two cases:
you are lucky and the record belong the page you're watching at;
the record is cached, but not currently displayed because the pagination.
The first case works fine, but the second would throw an exception because the non existent row. The simplest yet obvious thing to do is querying the grid in order to check the existence of the row.
If there's another way to do that, I'll happy to learn!
Thanks again.
Hello and congrats for this little gem.
I'm creating a real-time web app which should update the cells upon a socket notification. Everything works fine, but I had to dig into your code to get around of a problem. Here is my code:
NOTE: "item" is the reference of the record involved.
The recordset counts 100 rows, but the grid pages at blocks of 15. Now, when a notification hits a rows which is off the current page (highly probable), I must know in advance whether to update the cell or not. If I don't do it, the grid throws an exception.
For this reason, I suggest to expose (I mean publicly document) the "_rowByItem" method, which helped me.
The text was updated successfully, but these errors were encountered: