Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

fire event when Restfultable is completely loaded

rpenkert March 11, 2015

Hi,

JavaScript Code need to be excuted after a Restfultable is completely loaded.Following Code doesn´t work, the restfultable is loaded, but there is no alert :/ .

function createRestfulTable(path)
{
    AJS.$("#filter").html("");        //alte tabelle entfernen
    myRestfulTableInstance = new AJS.RestfulTable({
        autoFocus : true,
        el : jQuery("#filter"),
        allowEdit : false,
        allowDelete : false,
        resources : {
            all : path,
            self : path
        },
        columns: [
                  {
                      id: "x",
                      header: "x"
                  },
                  {
                      id: "xx",
                      header: "xx"
                  },
                  {
                      id: "xxx",
                      header: "xxx"
                  }
                  ]
    });
    myRestfulTableInstance.bind(AJS.RestfulTable.Events.INITIALIZED, function () {
           alert("finished setup");
        });
};

It quite looks like the API explains: https://docs.atlassian.com/aui/5.4.0/docs/restfulTable.html

What´s wrong with the Code?

Or are they alternative methodes how i can perfom my code after the Table is loaded ?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Daniel Wester
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2015

What are you trying to do (i.e. what type of code are you trying to execute afterwards)?

I believe that you'll need to bind the event to the jQuery object of the table. So something like

AJS.$("#filter").html("")
AJS.$("#filter).bind(AJS.RestfulTable.Events.INITIALIZED, function () {
           alert("finished setup");
        });
.. do restfultable stuff
0 votes
rpenkert March 12, 2015

That´s it.

Thanks. I binded the Evenet directly on the restfultable Objekt ... .

 

TAGS
AUG Leaders

Atlassian Community Events