vosi
January 30, 2016, 11:30pm
1
is there any convenient way to redefine how filtering URLs get formatted?
for now i’ve found a way by redefining webix.DataLoader._feed_common = (from, count, callback) →
what I need is to make filter URL not &filter[field]=value, but just field=value
in general, I need to make Webix compatible with Django rest framework
thanks
vosi
January 31, 2016, 4:46pm
2
forgot about proxy )))
webix.proxy.drfProxy =
$proxy: true
load: (view, callback) ->
url = @source
pager = view._settings.pager or
size: 10
page: 0
url += if url.charAt(url.length - 1) == '/' then '' else '/'
url += '?page='
url += pager.page + 1
for filter of view._filter_elements
record = view._filter_elements[filter]
if record[2].getValue(record[0]).length > 0
url += '&' + filter + '=' + record[2].getValue(record[0])
webix.ajax url, callback, view
Nar
January 31, 2016, 6:52pm
3
There are a couple of examples out there. This is a modified version of my implementation based off another users example. http://webix.com/snippet/20db1b79