2

I want to be able to specify what column triggers the data-toggle event so I can have other columns respond to a different event with out toggling the data.

Here's a plunk that will show what I'm seeing: http://plnkr.co/edit/wqyuuqNfb6qxXBWyHoRo

All columns in a row except the first and last will show a modal dialog when clicked. When the screen is shrunk and the data is collapsed, the toggle icon is displayed on the first column. When you click this icon, the data is toggled as expected. The problem I have is when you click the first name, the data is toggled and then the modal is shown. Is there a way to restrict the toggle event to just the column that is specified?

Jeff
  • 2,728
  • 3
  • 24
  • 41
  • 2
    I've seen the same problem. Actually, to me, it seems as if the whole row is active and receives the click event. Notice the mouse icon is the picker. I hope someone has the answer to this. – Bryan Feb 11 '14 at 06:44
  • 1
    I have same issue. I try develop solution with using footable_row_collapsed and footable_row_expanded events(http://fooplugins.com/footable/demos/events.htm#docs). But It doesn't work. – Dulitha K Feb 26 '14 at 08:21

2 Answers2

0

I found an solution. Just add a trigger to collapse the expanded data as below.

$("table").on("click","td:not(.footable-first-column)",function(e){
    var row=$( this ).parent();
    $(row).trigger('footable_toggle_row');

    $(".modal.fade").modal("show");
    return false;
});

Please find the solution in this plunk: http://plnkr.co/edit/QRQyhvvSOmz5oDlR0Cph?p=preview

Dulitha K
  • 2,088
  • 1
  • 19
  • 18
  • 1
    nice work. I would hesitate to call this a solution because this doesn't really solve the need to specify what columns trigger or not trigger the row expanding. (Maybe you could edit your answer to reflect that.) That being said, this does work and is what I will use until an actual solution is available. – Jeff Feb 26 '14 at 22:45
  • 2
    I am sure this is the solution that you need. Please read this https://github.com/bradvin/FooTable/issues/189#issuecomment-36249435 – Dulitha K Feb 28 '14 at 05:03
0

There was an update to https://github.com/bradvin/FooTable/issues/189#issuecomment-44100073.

I was using the answer by @Duli, but I think this works better.(I will keep his answer as the one I accepted)

When I initialize the table I add an option to change the toggleSelector and that causes the row to only toggle when the icon is selected and not the row.

$('.footable').footable({ 
    toggleSelector: " > tbody > tr > td > span.footable-toggle" 
});
Jeff
  • 2,728
  • 3
  • 24
  • 41