Mark Kadlec
Mark Kadlec

Reputation: 8460

How can I set a Table ID on the table generated by JQGrid?

I can't seem to find anything in the JQGrid documentation, but I want to select the table generated by JQGrid and want to set a unique ID on the generated table, is this easily done?

Upvotes: 0

Views: 1068

Answers (1)

Oleg
Oleg

Reputation: 222017

It seems a misunderstanding. To use jqGrid you should define at least the HTML fragment like

<table id="list"></table>

and use $('#list').jqGrid({/*parameters*/}) to convert the existing table to the grid. The unique id must exist before you call jqGrid. The id will be used to construct ids on other elements of grid. (see for example here for detailes). After creation of the grid you can't change the id of the table element. If it is really required to change the table id you have to destroy grid with respect of GridDestroy method, create new <table> element with the new id and then convert it to grid one more time.

Upvotes: 1

Related Questions