jquery - How to refresh the Partial View of in MVC, after using the delete button in a kendo grid -


i have kendo grid in view in asp.net mvc application. when press delete button(destroy function) in kendo grid, function called in controller delete object database. in meantime want refresh partial view grid on, in order refresh labels in view. possible add jq function destroy button example or there other solution?

here view code:

<div id="browsegrid">   @(html.kendo().grid<web02.configurationmodel.testgrid>() .name("grid") .columns(columns => {      columns.bound(o => o.name).width(110);     columns.bound(o => o.type).width(130);     columns.command(command => command.destroy()).width(110);       }) .sortable() .scrollable(scrollable => scrollable.virtual(true)) .htmlattributes(new { style = "height:430px;" }) .datasource(datasource => datasource     .ajax()     .model(model => model.id(p => p.name))     .events(events =>                           {                                 events.requestend("onrequestend");                            })     .pagesize(100)     .read(read => read.action("testgrid", "configuration"))             .destroy("testdelete", "configuration")         )     .pageable(pageable => pageable         .refresh(true)) )  </div> 

the script part: calls ajax request calling method in controller view partial view.

<script>  function onrequestend(e) {      $.ajax({          url: '/configuration/_workflowpartial',         contenttype: 'application/html charset=utf-8',         type: 'get',         datatype: 'html',         data: { 'nodename': nn, 'nodetype': nt, 'nodeid': ni, 'nodeurl': nu },         success: function (data) {             $('#body').html(data);         }     }) }  </script> 

instead of event mentioned in question, added:

.events(events => events.error("error_handler").sync("sync_handler")) 

javascript function:

function sync_handler(e) {     $.ajax({          url: '/configuration/_workflowpartial',         contenttype: 'application/html charset=utf-8',         type: 'get',         datatype: 'html',         data: { 'nodename': nn, 'nodetype': nt, 'nodeid': ni, 'nodeurl': nu },         success: function (data) {             $('#body').html(data);         }     }) } 

this avoid infinite loop took place before , calls partial page when delete button clicked. data passed model passed partial page.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -