Responsive: when table resizes bound elements lose their binding

Responsive: when table resizes bound elements lose their binding

tcardinaltcardinal Posts: 31Questions: 9Answers: 0

I have a responsive table and on each row there are a series of links whose clicks are bound by class to certain actions. The binding takes place in a drawCallback() event and all seems fine until the column collapses under the row as a result of the responsive changes.

Any ideas about what I can do? Is there a responsive event I have missed that I need to call to reapply the drawCallback()?

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    Can you show me the code please? What is the binding specifically - are you using a cell selector? If so, that would be the issue since it wouldn't match the responsive child row.

    Allan

  • tcardinaltcardinal Posts: 31Questions: 9Answers: 0

    The html within a cell is (spacing for ease of reading:

    drawCallback contains the following

    $(".fileaction").click(function( event ){
    event.preventDefault();
    fileDecision(this.id, true);
    });

    $(".commentOnReject").click(function( event ){
    event.preventDefault();
    var lValues = this.id.split("");
    popUpFormPart("commentField
    " + lValues[1], "fieldContainer_" + lValues[1], "Reject Comment");
    });

    This is fine when the column doesn't wrap, but once the column wraps under as part of the responsive stuff, these commands aren't linked.

    Thanks

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    Have a look at the second top FAQ - I think its basically the same issue.

    Allan

  • tcardinaltcardinal Posts: 31Questions: 9Answers: 0

    Thanks, that is what I thought the drawCallback overcame. I'll take a look at that approach

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin
    Answer ✓

    drawCallback isn't called when the Responsive display changes though.

    A delegated event is the way to go here!

    Allan

This discussion has been closed.