kendo Datasource return custom value -


i have remote datasource this,

var datasource = new kendo.data.datasource({     autosync: false,     batch: true,     transport: {         read: {             url: "some_url",             datatype: "json"         }     },     serverfiltering: true,     servergrouping: true,     serverpaging: false,     page: 1,     pagesize: 10,     schema: {         data: "results",         total: "total",         model: {             id: "id"         }     }     }); 

and 1 additional value serverside this.

    $response = array(         'results' => $product_alerts,         'total'   => $total,         'total_approved_products'  => 27     );     echo json_encode($response);     exit;    

is there anyway can value of total_approved_products in clientside ?

many thanks

alternative @onabai's solution following. both solutions not perfect picking object on parse dangerous in case have implemented read/update/create/delete, response objects hit parse , total_approved_products not there. suggest use complete event on datasource read.

read: {                     datatype: "json",                     type: "post",                     contenttype: "application/json; charset=utf-8",                     url: _op.servicebaseurl + "readx",                     complete: function (jqxhr, textstatus) {                             var result = jquery.parsejson(jqxhr.responsetext);                             alert(result.d.total_approved_products);                      }         } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -