34559

Jqgrid data update on live function click But not updating data

Question:

I am trying to update Jqgrid data update on live function click But not updating data.

I have tried jQuery('grid').jqGrid('clearGridData'); jQuery('grid').jqGrid('setGridParam', {data: dataToLoad}); jQuery('grid').trigger('reloadGrid');

also here is my grid code it is in a function and i am calling this function for each buttun click

jQuery("#procedureResultGrid").jqGrid({ loadonce:false, rowList : [ 10, 20, 50,100 ], data : jsonText, datatype : 'local', gridview: true, rowNum : 10, width : '100%', height : 'auto', colModel : [{ name : 'name', sortable:false, width : 130, classes: "col1" },{ name : 'rowv_1', formatter: valueFormatFunctionFirst, width : 60, sortable:false } ,{ name : 'row1', width : 25, formatter: calculatedFormatFunctionFirst, classes: "imageValue" },{ name : 'row4', width : 50, formatter: calculatedPersendFunctionFirst, classes: "persendValue" },{ name : 'rowv_2', formatter: valueFormatFunctionSecond, width : 60, sortable:false } ,{ name : 'row3', width : 25, formatter: calculatedFormatFunctionSecond, classes: "imageValue" },{ name : 'row4', width : 50, formatter: calculatedPersendFunctionSecond, classes: "persendValue" } ,{ name : 'rowv_3', width : 60, formatter: valueFormatFunctionThird, sortable:false } ,{ name : 'row5', width : 25, formatter: calculatedFormatFunctionThird, classes: "imageValue" },{ name : 'row6', width : 50, formatter: calculatedPersendFunctionThird, classes: "persendValue" } ,{ name : 'rowv_4', formatter: valueFormatFunctionForth, width : 60, sortable:false } ,{ name : 'row5', width : 25, formatter: calculatedFormatFunctionForth, classes: "imageValue" },{ name : 'row6', width : 50, formatter: calculatedPersendFunctionForth, classes: "persendValue" },{ name : 'rowv_4', formatter: valueFormatFunctionYTD, width : 60, sortable:false } ,{ name : 'row5', width : 25, formatter: calculatedFormatFunctionYTD, classes: "imageValue" },{ name : 'row6', width : 50, formatter: calculatedPersendFunctionYTD, classes: "persendValue" } ], pager : jQuery('#pager'), afterInsertRow: function (rowid, rowdata) { if(rowid%2==0) $("#procedureResultGrid").jqGrid('setRowData', rowid, false, { background: '#F2F2F2' }); else $("#procedureResultGrid").jqGrid('setRowData', rowid, false, { background: 'white' }); } }); $("#procedureResultGrid").fluidGrid({ base : "result-grid", offset : -20 }); $("#pager").show(); $("#procedureResultGrid").setGridParam({datatype:'local',sortname:'values.aggregate.'+totalCostIndex+'.data.'+addKeyYear(keyYear), sortorder: 'desc'}).trigger('reloadGrid');

I am also try sort it is also not working.

Answer1:

I just added from create grid and

$("#procedureResultGrid").GridUnload();

then

$("#procedureResultGrid").trigger('reloadGrid');

working fine for me..

Thanks

Recommend

  • How to retrieve values from JSON object in javascript [duplicate]
  • How to read json string in java? [duplicate]
  • ng-click not working in manually loaded HTML
  • Javascript Keyup Search for Div Values
  • jqGrid: Combining sortableRows and gridDnD (Duplicate Rows)
  • free jqGrid search parameter disappearing in filterToolbar
  • JqGrid Select Box in a cell
  • Ordering list with jQuery drag and drop
  • Date of max id: sql/oracle optimization
  • Ext JS, change grid column configs default values globally
  • Row_number() function for Informix
  • JQgrid : Change entire row's font color if one column is filled
  • formediting modals shows at wrong position
  • Converting datatype Char to Nvarchar
  • How can I implement a custom jqGrid delete button?
  • Oracle - Second level subquery cannot see field from main query
  • What is corresponding c++ data type to SQL numeric(18,0) data type?
  • apply a javascript function to draggable copy
  • Hibernate to update table schema
  • blade.php method outputting it's result to the form
  • pyodbc doesn't report sql server error
  • D3 get axis values on zoom event
  • Jackson Parser: ignore deserializing for type mismatch
  • OpenGL 3.3 on Mac OSX El Capitan with LWJGL
  • Change multiple background-images with jQuery
  • How to set/get protobuf's extension field in Go?
  • Trying to switch camera back to front but getting exception
  • How to show dropdown in excel using jrxml (jasper api)?
  • ORA-29908: missing primary invocation for ancillary operator
  • How to disable jQuery.jplayer autoplay?
  • NSLayoutConstraint that would pin a view to the bottom edge of a superview
  • How get height of the a view with gone visibility and height defined as wrap_content in xml?
  • How to stop GridView from loading again when I press back button?
  • Bitwise OR returns boolean when one of operands is nil
  • python draw pie shapes with colour filled
  • sending mail using smtp is too slow
  • Busy indicator not showing up in wpf window [duplicate]
  • costura.fody for a dll that references another dll
  • Why is Django giving me: 'first_name' is an invalid keyword argument for this function?
  • How can I use `wmic` in a Windows PE script?