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 grid colmodel having 1 column more. if use separate colnames, size of array have increased too. can use griddestroy example destroy existing grid. can bind column normal can show/hide them @ runtime using jquery. add column , hide/show per requirement using .

        $("#grid").showcol("column_name");         $("#grid").hidecol("column_name"); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -