jQWidgets Forums

jQuery UI Widgets Forums Grid Refresh grid after ajax save

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Refresh grid after ajax save #50522

    ssp
    Participant

    Hi,

    How will I refresh the grid on saving through ajax call:

     var dailyData =DayColGridDataField;
            var dailysrc =
          {
              datatype: "json",
              datafields:daydataFieldColumns,
          
              localdata: dailyData,
              url: 'jqxgridDaily.htm',         
          }; 
       $("#jqxgridDaily").jqxGrid(
                            {
                            width: 1015,
                             pagesizeoptions: ['10', '15', '20'],
                              pagesize: 15, 
                             source: dataAdapter,                
                                autoheight: true,
                                sortable: false,
                                pageable: true,
                                altrows: true,
                                editable: true,
                                enabletooltips: true,
                                theme: 'energyblue',
                				showstatusbar: true,
                                statusbarheight: 25,
                                showaggregates: true,
                                columnsheight: 50,
                                columnsresize: true,
                             selectionmode: 'multiplecellsadvanced',
                                    columns:daygridColumns                              
                                });
      $("#btnDailySave")
    		.click(
    				function() { 
    $.ajax(
    								{
    									url : "saveDailyEntry.htm,
    									cache : false,
    									type : "POST",
    									contentType:'application/json;charset=utf-8',
    									async : false,
    									dataType : "json",
    									data : JSON.stringify(editedRow)
    								})
    						 .done(
    								function(data) {
    									alert("Daily based TS Entry data saved essfully.");
    									$(
    											'#jqxgridDaily')
    											.trigger(
    													'reloadGrid');
    								}).fail(function() {
    									alert("Daily based TS Entry not saved. Please try after some time");
    						});
    						<strong>dailysrc.localdata = dailyData;
    						   $("#jqxgridDaily").jqxGrid('updatebounddata');
    						   dataAdapter.dataBind();</strong>
    					}
    				}
    
    				});
            });
    
    
    Refresh grid after ajax save #50565

    Dimitar
    Participant
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.