Is it possible to add Row Action on right hand side of each row?

PavithraPavithra Member
edited June 25 in Questions
I have a page to show List of all available open events in a table. I am trying to display a button against each row. On click of the button it should open up popup page where user can book for the event.

I could manage to achieve this by adding 'Row Action' (that display as a button 'Book Event' using css) where it shows button against each row and on click it opens up a popup allowing user to enter their details.

But we want these buttons 'Book Event' (Row Action) to show on right hand side of the page against each row, instead of left side of the table row. Is it possible to show on right hand side or is there any other way I can display button against each row?

Comments

  • Pat VachonPat Vachon Member ✭✭
    edited June 25
    You can move the td element using javascript. I think that's probably the easiest way.
  • PavithraPavithra Member
    edited June 25
    How do I move the td element. Do you have any examples please?
  • Pat VachonPat Vachon Member ✭✭
    edited April 2016
    Honestly don't know yet. Just know it's possible. Google teaches everytime that it's possible.
  • PavithraPavithra Member
    edited April 2016
    I got it thank you.

    Below code for reference:
    $('tr').each(function(){
        $('td:first',this).remove().insertAfter($('td:last',this));  });
  • PavithraPavithra Member
    edited April 2016
    It moves the td, but the popup doesn't work. :(
  • Barry SchnellBarry Schnell Member ✭✭
    edited February 2017
    Hello Pavithra -

    I haven't tried this and not 100% sure it would work but given the code you have above, the problem that you are using remove() where you would want to use detach().

    remove() will completely remove the element from the DOM along with any data and event listeners associated to that element.  Skuid uses element data and event listeners to trigger and support the beahvior on the action (e.g. onClick, popup definition, etc.)

    If you want to relocate the element, try using detach() instead.  

    Hope this helps!


  • PavithraPavithra Member
    edited April 2016
    Awesome! It worked really well.. Thank a heaps...
  • Pat VachonPat Vachon Member ✭✭
    edited June 25
    Now that you've done this, I can being able to create row actions and place pretty anywhere in the table as well.

    Very cool and useful.
Sign In or Register to comment.