Hi all,
I have a json file where I have defined a button widget. On click of this button, the on click method defined in the corresponding javascript file is called and the action is performed.
After performing the onclick event, I want to return a value back to the calling file – json file.
Can this be done?
Please find the json file and the corresponding java script file below
button.json:
{
“type” : “button_select”,
“id” : “btnSelectAll2”,
“region” : “header_3:region_2:region_2:region_1:r4:c2”,
“params” :
{
“name” : “SelectAll”,
“text” : “Select All”,
“buttonStyle”: “btn white”,
}
}
button_select.js:
$(“#id” + button).click(
function()
{
var allitems = $(“#id” + button).jqxListBox(‘getItems’);
var n= allitems.length;
$(“#id” + button).jqxListBox(‘clearSelection’);
var selecteditems = new Array();
var tot =0;
for(var i=0; i<n;i++)
{
$("#id" + button).jqxListBox('selectIndex', i) ;
selecteditems[tot] = $("#id" + button).jqxListBox('getItem', i );
tot++;
}
/* I need to pass the array, selecteditems[tot] to the json file- button.json */
} );