Calling function from control designer - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Calling function from control designer

  • Calling function from control designer
  • Hi,

    I have a control designer which has all the usual applyChanges, refreshUI etc. How can I write a function that I can calls another function, not via an event handler. e.g.

    refreshUI: function()
    myfunction();
    ,
    myfunction: function()
    alert('hi world');


    Thanks
    higgsy
  • Hi higgsy,

    You are on the proper path to achieving this. When you call the function from other function you should use this.myfunction(). Consider sample bellow:
    refreshUI: function ()
        this.myFunction();
    ,
     
    myFunction: function ()
        alert("hello world");


    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  • Hi Radoslav,

    Thanks for your response, one other thing though - how do you pass parameters to that function, i.e.:

    refreshUI: function ()
        this.myFunction('Hello world');
    ,
      
    myFunction: function (inputString)
        alert(inputString);

    Thanks
    higgsy
  • 250714_alerttest.zip
    Hi higgsy,

    There should not be a problem if you have this scenario

    refreshUI: function ()
        this.myfunction("test");
     
    ,
     
    myfunction: function (param)
        alert(param);
    ,

    I attached short video

    Kind regards,
    Ivan Dimitrov
    the Telerik team