Kendo UI Grid column sorting refreshes entire page -


i have page contains 2 tabs. tab 1 contains kendo bar charts. tab 2 contains kendo grid search results , 2 tabs contain 1 kendo grid each detail information. "change" event of search results grid makes ajax call update 2 details grids details of item selected. want 2 details grids sortable. when click on column sort data, entire page refreshes , takes me first tab contains kendo bar charts. search results grid sortable , works expected. doesn't refresh entire page when click on column sort by. so, how allow 2 details grids resort without refreshing page?

note: have noticed, when screen refreshes due sorting, controller action isn't being called. so, refreshing screen not re-executing controller code - not sure if helps or not.

html gets replaced ajax call:

<div id="groupdetails">     <div class="panel-body">         <ul class="nav nav-tabs" id="detailstabs">             <li class="active"><a href="#tab-diagnosis" data-toggle="tab">diagnosis</a></li>             <li><a href="#tab-procedure" data-toggle="tab">procedure</a></li>         </ul>         <div class="tab-content">             <div class="tab-pane active" id="tab-diagnosis" />             <div class="tab-pane" id="tab-procedure" />         </div>     </div> </div>   

search results grid:

 $("#searchresults").kendogrid({         datasource: { data: mdl,},         selectable: true,         sortable: true,         pageable: false,         change: function(e) {             var itm = this.datasource.view()[this.select().index()];             $.ajax({                 type: "get",                 url: "@url.action("groupdetails", "analytics")",                 data: {idx: itm.idx, name: itm.name},                 success: function (r) {                            groupdetails.html('');                                                 groupdetails.html(r);                 }             });         }   }); 

ajax result:

        <div class="panel-body">     <ul class="nav nav-tabs" id="mytab2">         <li class="active"><a href="#tab-diagnosis" data-toggle="tab">diagnosis</a></li>         <li><a href="#tab-procedure" data-toggle="tab">procedure</a></li>     </ul>     <div class="tab-content">         <h1>service line: @model.name</h1>         <div class="tab-pane active" id="tab-diagnosis">             @html.kendo().grid(model.diagnosisdetailsresults).name("diagdetailsresults").columns(                 column =>                 {                     column.bound(c => c.name).title("description");                     column.bound(c => c.totalcharged).title("charged").format("{0:c0}").width(175);                     column.bound(c => c.totalpayments).title("revenue").format("{0:c0}").width(175);                 }).sortable().scrollable().selectable(selectable => selectable.mode(gridselectionmode.single).type(gridselectiontype.row)).datasource(datasource => datasource.server().model(model => model.id(item => item.idx)))         </div>           <div class="tab-pane" id="tab-procedure">             @html.kendo().grid(model.proceduredetailsresults).name("proceduredetailsresults").columns(                 column =>                 {                     column.bound(c => c.name).title("description");                     column.bound(c => c.totalcharged).title("charged").format("{0:c0}").width(175);                     column.bound(c => c.totalpayments).title("revenue").format("{0:c0}").width(175);                 }).sortable().scrollable().selectable(selectable => selectable.mode(gridselectionmode.single).type(gridselectiontype.row)).datasource(datasource => datasource.server().model(model => model.id(item => item.idx)))         </div>     </div> </div> 

that happens because details grids both server binding grids, of course when try sort grid, request sent server , page refreshed. need change data source ajax if don't want sort refresh page.

<div class="tab-pane active" id="tab-diagnosis">     @html.kendo().grid(model.diagnosisdetailsresults).name("diagdetailsresults").columns(         column =>         {             column.bound(c => c.name).title("description");             column.bound(c => c.totalcharged).title("charged").format("{0:c0}").width(175);             column.bound(c => c.totalpayments).title("revenue").format("{0:c0}").width(175);         }).sortable().scrollable().selectable(selectable => selectable.mode(gridselectionmode.single).type(gridselectiontype.row)).datasource(datasource => datasource.ajax().serveroperation(false).model(model => model.id(item => item.idx))) </div>   <div class="tab-pane" id="tab-procedure">     @html.kendo().grid(model.proceduredetailsresults).name("proceduredetailsresults").columns(         column =>         {             column.bound(c => c.name).title("description");             column.bound(c => c.totalcharged).title("charged").format("{0:c0}").width(175);             column.bound(c => c.totalpayments).title("revenue").format("{0:c0}").width(175);         }).sortable().scrollable().selectable(selectable => selectable.mode(gridselectionmode.single).type(gridselectiontype.row)).datasource(datasource => datasource.ajax().serveroperation(false).model(model => model.id(item => item.idx))) </div> 

by way, why using razor details grids, not main one? consistent.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -