I want to create one box in Jqxtoolbar it contains 4 different values like A,B,C,D … in switch case i want to apply same condition for all 4 but value only will differ based on click … how to do this?
here is my code how to do this in jqxtoolbar?
case 0:
tool.text(‘A’);
tool.jqxButton({ width: 50 });
tool.click(function() {
data = {
content: ‘Apple’
};
});
break;
case 1:
tool.text(‘B’);
tool.jqxButton({ width: 50 });
tool.click(function() {
data = {
content: ‘Ball’
};
});
break;
case 2:
tool.text(‘C’);
tool.jqxButton({ width: 50 });
tool.click(function() {
data = {
content: ‘Car’
};
});
break;
case 3:
tool.text(‘D’);
tool.jqxButton({ width: 50 });
tool.click(function() {
data = {
content: ‘Donut’
};
});
break;
// i want to apply this to all of the above 4 , here only the data content alone changed .
sel_rows = $(‘#leaves_list_grid’).jqxGrid(‘getselectedrowindexes’);
opt = {
data: data,
method: ‘POST’,
url: “/external_api/”
};
save(opt)
thanks!