rocky
June 10, 2014, 6:11pm
1
Hi Everyone:
Is there a simple function or parameter that sets richselect combo as the size of the pager coding? So when a user selects 20 view pages, the pager size is then set to display 20…
var toolbar = {
view:"toolbar",
elements:[
{
view:"richselect", width:170, labelWidth:90,
label: 'View Pages', labelAlign:"left",
value:1, options:[
{ id:1, value:"10" },
{ id:2, value:"15" },
{ id:3, value:"20" },
{ id:4, value:"50" }
]
},
{view:"search", align:"right", placeholder:"Search by keyword", id:"searchfilter", inputWidth: 250}
]
}
http://docs.webix.com/samples/15_datatable/19_paging/07_localization.html
maksim
June 13, 2014, 4:05am
2
You can use onChange event of richselect, from it you can use something like
$$("pager").define("size", this.getValue())
$$("pager").refresh();
rocky
June 13, 2014, 3:51pm
3
Getting error with define… also tried using .set, attr, and .setAttribute … same result
$$(“pager”).define(“size”, this.getValue())
rocky
June 13, 2014, 6:22pm
4
click:function works but not onchange:function as below
var toolbar = {
view:“toolbar”,
elements:[
{
view:“richselect”, width:170, id:“toolbarViewPages”, labelWidth:90,
label: ‘View Pages’, labelAlign:“left”,
value:1, options:[
{ id:1, value:“10” },
{ id:2, value:“15” },
{ id:3, value:“20” },
{ id:4, value:“50” }
],
onchange:function(){
//alert(this.data.text);
//console.log (this);
pagerSize = this.data.text;
//pagerGroup = Math.ceil(resultData[‘data’].length / pagerSize);
//grid.refreshGrid ();
alert('pS = ’ + pagerSize );
}
},
{view:“button”, value:“Status”,width:70},
{view:“search”, align:“right”, placeholder:“Search by keyword”, id:“searchfilter”, inputWidth: 250}
]
}
rocky
June 13, 2014, 7:50pm
5
I was able to get on: { onchange:function() … } to work. Thank you guys.