ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: yulia on March 27, 2014, 11:30:59 pm

Title: Columns become non-editable after grid data reload
Post by: yulia on March 27, 2014, 11:30:59 pm
I'm using dataModel = 'local' and loading data manually. When I reassign pqGrid, the columns that were editable on initial load are no more editable.

If I destroy pqgrid before 2nd load, it fixed the problem, but sometimes I don't know if pqgrid is already loaded (and if it's not and I call destroy, and error occurs). I tried to see if there's an API that will tell me fi the grid is loaded and couldn't find anything.

Here's my code.

    var dataSource = dataArray;
    var obj = {};
   obj.width = 1000;
   // obj.height = 400;
   columnModel = [     
      {title:"SeedWeightID", hidden:true},
       {title:"Plant", width:150, dataType:"float", align:"right", className:'grid-col', editable: false},
       {title:"", width:350, dataType:"float", className:'grid-col', editable: false},
       {title:"", width:150, dataType:"float", className:'grid-col', editable: true},
       {title:"", width:150, dataType:"string", className:'grid-col'},
       {title:"", width:150, dataType:"string", className:'grid-col'}
       ];
   dataModelSource = {data: dataSource};
   $( "#grid_array" ).pqGrid(
          {scrollModel:{pace: 'fast', horizontal: false} },
          {editModel:  {saveKey: 13}},
          {editable: true},
          {flexWidth: true} ,   
          {flexHeight:true},
          {colModel: columnModel},
          {dataModel: dataModelSource},      
              obj );

Any suggestions?


Title: Re: Columns become non-editable after grid data reload
Post by: paramvir on March 27, 2014, 11:40:36 pm
pqGrid constructor accepts only one argument object, but you are trying to pass number of different objects to it.
Title: Re: Columns become non-editable after grid data reload
Post by: yulia on March 27, 2014, 11:50:01 pm
Oh, I didn't realize that! Thank you so much for pointing it out, it did solve the problem!