extjs5 - Extjs Store Getting Data from Post -
good morning,
i have search endpoint works when call this:
ext.ajax.request({ url: '/search/false', method: 'post', headers: { 'content-type': 'application/json' }, params: 'attribute:closeddt;value:2014-12-16', success: function(conn, response, options, eopts) { alert(conn.responsetext); }, failure: function(conn, response, options, eopts) { alert(conn.responsetext); } });
i want use proxy load store directly. after googling have tried , post /search/false?_dc=1418738135737 net::err_empty_response
see current code below:
var proxydefinition = { type : 'rest', api : { read : '/search/false' }, actionmethods : { read : 'post' }, reader : { type : 'json' }, paramsasjson:true }; returnvalue = ext.create('ext.data.store', { model: 'mdl1', proxy: proxydefinition }); returnvalue.load({params: 'attribute:closeddt;value:2014-12-16'});
the params config needs object, not string. extjs encode because of paramsasjson: true.
you should use:
params: { attribute: 'closedt', value: '204-12-16' }
Comments
Post a Comment