jQWidgets Forums

jQuery UI Widgets Forums Editors Button, RepeatButton, ToggleButton, LinkButton Returning value from java script to json on click of a button

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 12 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • cishwarya
    Member

    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 */
    } );


    Dimitar
    Participant

    Hello cishwarya,

    Unfortunately, there is no such built-in functionality in jQWidgets.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.