jquery - JQGrid Column Customization ..Add Column at Run time -
am new j query , trying samples in http://www.trirand.com/blog/jqgrid/jqgrid.html see column names written in js displayed in grid.
i have requirement on jqgrid show column search every time.
example: have standard set of columns displayed in grid student name, address,phone number.
suppose if user search student id need add student id column result.
i should show
"student name, address,phone number,studentid"
if search total
i should show
"student name, address,phone number,total"
to simplify need add 1 column jqgrid after user clicks on search.
can in jqgrid. how can implement ?
this answer taken older version of oleg's answer here:
it not possible add column
jqgrid
dynamically. have recreate whole gridcolmodel
having 1 column more. if use separatecolnames
, size of array have increased too. can usegriddestroy
example destroy existing grid. can bind column normal can show/hide them @ runtime usingjquery
. add column , hide/show per requirement using .
$("#grid").showcol("column_name"); $("#grid").hidecol("column_name");
Comments
Post a Comment