views:

734

answers:

1

Here is my FlexiGrid

$("#grUser").flexigrid({
    url: 'someJSON.php'
    , dataType: 'json'
    , colModel : 
    [
     {display: '', name : 'Index', width :100, align: 'left'}
     , {display: '', name : 'Value', width : 100, align: 'left'}
    ]
    , title: 'Details'
    , width: 350
    , height: 200
    , singleSelect: true 
});

The show/hide columns feature in the header is really cool option, but I want to specify on which column to be available and I am having trouble finding a good documentation about what are my options in specifying the colModel. Here

{display: '', name : 'Index', width :100, align: 'left'}

What else can we put in the definition of a column?

Additionally - what is your documentation source for FlexiGrid?

+4  A: 

Unfortunately, documentation for this isnt there, thus very frustrating, you have to look at the source code and see what you can do.

It's a little late, but incase anyone scours this.... Just add 'hide: true' as shown below. Setting hide to true, will hide a column.

{display: 'Row ID', name : 'id', width : 100, sortable : true, align: 'left', hide: true}

You can set the following attributes: - display (this is what is used for column headings)

  • name (this is the database field name used for ajax calls)

  • width

  • height

  • sortable: true/false

  • align: left/center/right

  • hide: true/false

  • searchable: true/false (only applicable if you have the search bar turned on)

Gavin
+1, thanks for the answer. This is what I found myself, after all I ended with so changed/custom Flexigrid.js, that I can not even use it elsewhere... :)
Svetlozar Angelov