How to load dynamic data to grid
How to load dynamic data to grid
rakshitha
Posts: 6Questions: 1Answers: 0
Hi,
How to bind jqGrid dynamically?. The columns are not available at design time but will only be available only at runtime.The columns are should be from database.Is possible?we can use ajax scripts also.
Regards,
This discussion has been closed.
Answers
This is the forum for DataTables. jqGrid is not the same as DataTables.
then is possible to use data tables? without using column names,
I built this simple example to build dynamic columns from the AJAX response:
http://live.datatables.net/fafuyeyu/1/edit
It builds the column names from the field names returned. But the AJAX response could contain a specific object with the column names.
Kevin
hi,
This is fine,but i want to display column name from db,without giving HTML part,
using server side processing,
is possible?
Yes, you don't need to define the thead. You can remove that form the example and see that it works.
I believe with server side processing you need to define an
ajax
option within the Datatable config. You would then need to execute an external ajax request to get the column names before the Datatables initialization.Kevin
Hi,
i understand,but am beginner of datatables plugin,can u give with example
http://live.datatables.net/cinomoni/1/edit
That shows an empty
table
where thecolumns.title
option is used to define the column headers. If you need to get that information via Ajax, you can do so with a simple$.ajax
call.Allan
Hi sir,
i want to display large amount of datas to grid using serverside processing,you a gave sample example that is all fine sir,
but i need to use without giving column name in html parts and ajax side also,
is possible ?
So you don't want to give the column information either in HTML, or in Ajax loaded data. Where do you want to give the column information then? The columns have to be defined somewhere.
Allan
Column name should be from database
is possible in ajax loaded data?
Yes - I gave an example of that above. You make an Ajax call to the server to get the column information. There would be a server side script which will get the information you want and send it back to the client.
Allan