[how to add more list]Jquery Grid sample

20 views
Skip to first unread message

park

unread,
Jan 25, 2010, 7:17:00 AM1/25/10
to StreamHub Comet Server Community
I am trying to live update list with Jqgrid.
The sample Demo of java-adapter-sdk is defined symbol[BA,BAC..etc].
This mean Fixed Row-record[symbol].
If I want to make dynamic top 5 lists that growing record, how can I
defined "symbols"?
symbol list shuld change every time whenever growing table record.

any idea or sample code?

Thank you in advanced!

StreamHub Team

unread,
Jan 31, 2010, 9:12:35 AM1/31/10
to StreamHub Comet Server Community
Hi park,

Not quite sure what you want to do here. To add something to the
grid, try:

symbols.push("MY_NEW_SYMBOL");
int rowIndex = symbols.length;
$("#grid").addRowData(rowIndex, {
Symbol: "MY_NEW_SYMBOL"
});
hub.subscribe("MY_NEW_SYMBOL");

To remove something from the grid, try the folowing:

int rowIndex = indexOf("MY_NEW_SYMBOL", symbols) + 1;
removeFromArray("MY_NEW_SYMBOL", symbols); // code not provided -
google is a good bet e.g. http://ejohn.org/blog/javascript-array-remove/
hub.unsubscribe("MY_NEW_SYMBOL");
$("#grid").delRowData(rowIndex);

Hope this helps,

The StreamHub Team

park

unread,
Jan 31, 2010, 8:20:07 PM1/31/10
to StreamHub Comet Server Community
Thank You for reply.
We want to make list-module include record insert/update some filed
value (Oracle Table) at event.
list-module show recently top 30 records with jQueryGrid.
If table have 30 records, grid show 1~30 per 1 page.
if record(31'th) is inserted, grid update from 1~30 to 2~31 per 1
page.
And if known some 2 fields is updated,grid update field value.

as above, we want to push this 30 records changing every event ,but
only push server see table record inserted/updated.
Point is how to control changing symbol list with push server ,or any
other method.


On 1월31일, 오후11시12분, StreamHub Team <streamhubt...@googlemail.com>
wrote:


> Hi park,
>
> Not quite sure what you want to do here.  To add something to the
> grid, try:
>
> symbols.push("MY_NEW_SYMBOL");
> int rowIndex = symbols.length;
> $("#grid").addRowData(rowIndex, {
>     Symbol: "MY_NEW_SYMBOL"});
>
> hub.subscribe("MY_NEW_SYMBOL");
>
> To remove something from the grid, try the folowing:
>
> int rowIndex = indexOf("MY_NEW_SYMBOL", symbols) + 1;
> removeFromArray("MY_NEW_SYMBOL", symbols); // code not provided -

> google is a good bet e.g.http://ejohn.org/blog/javascript-array-remove/

Reply all
Reply to author
Forward
0 new messages