Facing a couple of problems which are specific to my implementation (can't reproduce)

Facing a couple of problems which are specific to my implementation (can't reproduce)

gauravmakgauravmak Posts: 22Questions: 4Answers: 0

Hello,
I just updated my datatable implementation with new extensions - Buttons and Select.
I am facing a couple of problems which I couldn't find why.

1) Automatic selection of rows upon new draws of datatable.
2) Excel export button now working. Error - Uncaught TypeError: Cannot read property 'length' of null. (Flash as well HTML5)

I have debugged datatable twice and here are the links :
1) http://debug.datatables.net/ahisun
2) http://debug.datatables.net/etegul (Next draw when I clicked Page 2. Rows automatically selected)

PS - Don't know why but it does not say Select extension is installed but it is.

This question has accepted answers - jump to:

Answers

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    I just found that rows get selected even when datatable is drawn for the first time. Though 'selected' class is not added to the rows, It bring me all the visible rows when I use rows() api with 'selected' modifier.

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Tik tok. One more surprise. Fetching with 'selected: false' also fetches all the rows.
    And can't deselect with click or api. I mean there is no way I can desect them. rows() always returns all of them.

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin

    Can you link to the page so I can debug the issues please. Unfortunately the debugger doesn't provide enough information to be able to resolve these ones.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0
  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin

    Super - thanks. I'll take a look into this tomorrow.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Thank you

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin
    Answer ✓

    1) Automatic selection of rows upon new draws of datatable

    This turns out to be the same issue as reported here. It is a compatibility issue between DataTables and jQuery 2. A fix has been committed and will be released in DataTables 1.10.9 (which will likely be the end of next week).

    2) Excel export button now working. Error - Uncaught TypeError: Cannot read property 'length' of null. (Flash as well HTML5)

    Apologies - this is a bug in Buttons. I will be releasing 1.0.1 with the fix on Friday. Until then, if you like, you can load the latest version of the export buttons locally (it will overwrite the CDN included code on your page) which will address that issue.

    Regards,
    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Thanks for the update. Appreciable. I will wait for the updates.
    I thought the problem was with my implementation only because the examples on the site and the examples from the downloaded library work very well. This comment relieved me ;)

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0
    edited August 2015

    Will I be notified when the updates are done? Or both the problems will be automatically solved as I am using CDN?

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin
    Answer ✓

    Or both the problems will be automatically solved as I am using CDN?

    No - the CDN is version locked to the files you select. You don't want the files changing on you if you include files from the CDN!

    The release feed will be updated when the new release is available.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Yeah, right. New versions will be released, correct?
    I will keep an eye anyway. Thank you.

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin

    Buttons 1.0.1 will drop tomorrow.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    First problem persists with 1.10.9 as well. What may be the reason?

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin

    1) Automatic selection of rows upon new draws of datatable

    This is a Select issue I suspect. Have you tried the Select nightly version? If so, and the problem continues, please link to a test case showing the issue.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Issue persists with nightly version of Select as well :(
    Link to the page - http://hubsb.net/cakepos/suppliers

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin

    Rows don't appear to be selected for me. I select a row on page 1 and then move to page 2 and no row is selected there.

    Of course when I then page back to page 1, again no row is selected, but that is because you have server-side processing enabled. Row selection is for the page disabled only when server-side processing.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Yeah, selected class is not added to the rows but "table.rows( { selected: true } )" returns all of them. Its always been like this. Have a look at First 2 replies of this thread please.

    To confirm that, click on Bulk Edit button please. It shows the number of seleted rows in the title of the bootstrap modal box.

  • allanallan Posts: 54,743Questions: 1Answers: 8,565 Site admin
    Answer ✓

    It took a bit of debugging, but the error is here:

    selected = table.rows( { selected: true } ).data().rows().ids();

    It should be:

    selected = table.rows( { selected: true } ).ids();
    

    i.e. the issue is that you are calling rows() again without any selectors, and therefore, yes, it was returning all rows.

    Allan

  • gauravmakgauravmak Posts: 22Questions: 4Answers: 0

    Yeah, right. I don't know from where in the world I brought that line. Really disappointing. I beg your pardon for the same and thankful for the support.
    Have an awesome weekend.

This discussion has been closed.