Home › Forums › Guriddo jqGrid JS › Help › real time update with streaming data
i am evaluating jqgrid for our project to replace what we are using currently. the main requirement we have is it should update cell values realtime (streaming fiancial) data.. is there a way to do that ? like only render the changed cell value.. rather than updating whole grid/visible rows.. if you have any demo example.. that would be great help
Hello,
It is possible to do this, but we need to know some more information, before to recommend a solution.
How is the data loaded? – at once – all the data (with paging) or not every time the user sort or page the data it is loaded from the server?
This question is related in connection of the first case above.
When the fresh data come – what contain this data – the changes in the whole grid data or only in the current page?
These different cases make the implementation different.
Kind Regards,
Will
Guriddo Support Team
here is the details
initially grid is loaded with static data.(from server) and data can be paged.but all of them are loaded.. then whatever page is visible..gets updated data couple of times a seconds. lets say grid has
AAPL, 45.67
MSFT,67.89 etc.
with frequent updates, i have to find the rowId and update cell values.. no new rows are added once grid is loaded, only cell values gets updated frequently. the most important thing we need to know something like ‘beforeSort’ so that i can find out old data.. and let server know NOT to send updates for old data.. and after sort, whatever is visible on current page, i can request update from server.
currently we are using other grid plugin, but its performance is not even acceptable, after 10 minutes of updates, whole browser becomes un-responsive. thats the main reason why we are looking for new solution.
thanks
Hello,
I find this task very interesting and have prepared a demo.
The main idea is as follow:
– The grid initially is loaded with loadonce : true. This instruct grid to load all the data from the response, and display only the number of rows set in rowNum parameter and switch to local mode.
– in gridComplete event we check if we have data for update and if not we get the visible rowId and call the setInterval function which call ajax to get the fresh data from these ids.
– in setInterval function we use setRowData, since I suppose that not only one cell per row will be updated. In case there is only one cell for update, then s setCell method can be used.
– when the user do a pagging or sorting, before these actions we clear the interval function – i.e we disable update and , and clear the array with the current ids.
Here is the demo
Please let us know if this solves your prblem
Thank you.
Best Regards,
thanks a lot for demo.. this exactly is what i am looking for. i will use demo to make things work for real in our app.
thanks again..
i do have few basic questions,
is there a easy way to turn off paging ?? would this impact performance if i have like 500 rows in table.. and i am updating cell values real time( as in above requirement)
if enable paging ?? how can i position pager to the bottom of the table.. like table would take 90% of parent height regardless of rows then 10% would take pager.. this way pager will be at the fixed position regardless of number of records..
i am still trying to read documentation and getting familiar with the product..so far looks great..
thanks..
Hello,
To turn off paging you can disable paging buttons. A good documentation about it can be found here
The performance is a relative thing. If the paging is at client side there is no problem with 500 rows
The height of the grid can be set fixed instead of auto or 100%. By example if you set height : 300 in grid setting this will set 300 of the rows and additionally a place for the pager http://www.guriddo.net/documentation/guriddo/javascript/#how-it-works
Also you may want to look at our demo here : http://www.guriddo.net/demo/guriddojs/
Kind Regards,
Will
Guriddo Support Team
hello
i do have few more questions. how do export works (basically just to csv) i tried using jqGrid(‘exportToCsv’, {fileName:’name’}); and it works, but how do i hide some columns from export.. and how do i modify for custom formatter ?
we are ready to buy license ($299) . does this include some custom work if we need to ? i know this include 10 hours of support time.. but is there a limit in which we have to use those hours of purchasing (like first 90 days..)
thanks
Hello,
In the last version you can use the option exportcol set to false in colModel: See here
Also see the options parameter passed to custom formatter isExported in the same link.
We always try to help solving the problems and we do not count the hours with chronometers.
Kind Regards,
Will
Guriddo Support Team
thanks i tried using exportcol:false and its working fine. but i am not getting isExported = true when exporting with custom formatter..
function scoreFormatter(cellvalue, options, rowObject){
console.log(options.isExported) –> this is always undefined
}
i do have exportcol:true in colModel
is there anything i am missing?
Hello,
Sorry for the mistake. The isExported property is in our Development version.
Please, send a e-mail to support at guriddo dot net to get the version with this property.
Sorry again for this inconvenience.
Kind Regards,
Will
Guriddo Support Team
one more question. how can i control the alignment of column header ? i want some columns title to align left and some to align right .
thanks
Hello,
Please for new questions create new post.
Use the setLabel methd. See docs
Kind Regards,
Will
Guriddo Support Team
i have problem formatting data with dates. from server i am getting unix timestamp like ‘1494216000000’.. i tried below in colmodel
{label:’Ex Div Date’,name:’divExDate’,width:100,sorttype:’date’,align:’right’,formatter:’date’,formatoptions: {srcformat:’U’,newformat:’ShortDate’}}) which is not working..
then i converted unix date into something like
$grid.jqGrid(‘setCell’, rowId, “divExDate”, “2017-05-17”);
with
{label:’Ex Div Date’,name:’divExDate’,width:100,sorttype:’date’,align:’right’,formatter:’date’,formatoptions: {srcformat:’Y-m-d’,newformat:’ShortDate’}});
which is not working as well..
what is the default format which i can use so that sorting and displaying works properly.. ( i can format server date to whatever default format jqgrid is expecting)
Thanks
one more question..
how can i use frozen columns without setting width of grid.. i do want grid to take parent width.. (thats why i am not setting width:xxx) then frozen:true would not work..
but if i do $grid.jqGrid({
width:700,
xx…..
});
$grid.jqGrid(‘setFrozenColumns’);
then things are working.. but if i removed ‘width:700’ then frozen is not working..
Hello,
New questions require new topics.
Regards,
Will
Guriddo Support Team
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top