ASP.NET MVC + jqGrid -


I am using jQgrid with asp.net MVC I am having some problems when I was created DOM, So I would like to draw a grid, but I would like to load the data, when I select the tab in a tab page. I can not find any examples for this

I am using a custom navigation bar: ("#AttagentsGrid") Navigrid ('# attachments pager', edit: wrong, add: true, del: true, search: wrong});

After some selection on the tab (jQuery UI), I can see that buttons of nav bar are repeated. With the selection I have a big problem. I can not choose any other line but before anyone had to face the same problem?

Best Relationship

Alberto

To prepare the DOM To prepare the grid, but to populate it later, you can initialize the grid using the local data store:

  Datatype: "local"  < / Pre> 

Then, when you select the appropriate tab, start an AJAX request to get your data. When the data is retrieved, you can do this to load it in the grid:

  // populated grid data jQuery ("# ​​myGrid"). ClearGridData (); If (data! = Null) {for (var i = 0; i & lt; data langhai; i ++) {jQuery ("# ​​myGrid"). AddRowData (data [i] .id, data [i]); }}}  

After selecting a tab several times, I have seen it many times before starting the Jackgread before duplicate button (IE, each time the tab is selected. Calls jqGrid). You should not see this after following the steps above. Otherwise, there is a way to check this when the grid is tracked initially, and only the grid is started when the related tab is selected:

  var initialized = false; JQuery ('# Tab'). Tab ({Show: Function (Event, UI) {if (ui.index == 1 & Initialized) {initialized = true; (... Build your grid here ...}}}});  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -