How to regroup in the same group the same information with datatable

How to regroup in the same group the same information with datatable

LeamsiLeamsi Posts: 8Questions: 1Answers: 0

Hello,

I'm going a personal project using bootstrap and dataModel. Here what I've so far:

I have 2 same information (Macbook Pro 17") and normally, it should go both under Macbook Pro 17", but its not. I tried to check why, and when I remove ordering: false from my code here is what I have.

But there is the 2 arrow beside ID, References and Disponibility and I don't want that.

Do someone have a clue to how to keep this "group" without using this sort code ?

Cordially

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0

    Hello,

    Sorry, I did put my project in pause. Here is the link to the test case:

    http://live.datatables.net/cogaluqi/1/edit?html,js,console,output

    Inside the JS, when you remove "ordering false", you can see that everything in under the good tittle. But when you click on "name", "position"... it also click on the ordering arrow. What I'm trying to do is the same thing as when you remove the "ordering false", but without the ordering's arrow.

    Cordially

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    You probably need two header rows, like this example:
    http://live.datatables.net/gepatita/1/edit

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0

    Still not working :neutral:

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    Please update your example.

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0
    edited April 2020

    I just saw that inside this example, there is a little bit of js, but I do not know how to include it inside my own js. I guess the error came from the js. I'm trying that right now.

    EDIT: Here is the new link: http://live.datatables.net/cogaluqi/1/

    Still not working..

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    The example I linked to shows two rows inside the table header. Look at the HTML.

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0

    I did the change, but still doesn't work =(

  • kthorngrenkthorngren Posts: 20,257Questions: 26Answers: 4,761

    Here is an example of using select input searches in the second header with scrollX.
    http://live.datatables.net/saqozowe/70/edit

    Kevin

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    @Leamsi - unless you update your test case we have no idea what you have done.
    Just saying "still doesn't work" is not helpful.

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0

    Well, I think I wasn't clear enough about my problem.

    On my example (http://live.datatables.net/cogaluqi/1/edit?html,js,output ), you can see on the output that there is twice the "edinburgh" section (see the screen below).

    What I want, is that only one "edinburgh" section should show, and not 2.

    If you have any question, please don't hesitate,

    Cordially

  • kthorngrenkthorngren Posts: 20,257Questions: 26Answers: 4,761

    Sorry, thought you were working on the column searches. In order for the RowGroups to be grouped together you need to sort by that column. Currently you have ordering: false which disables ordering, see more here ordering.

    Instead you can use columns.orderable to turn off the ability of the user to order the table then use order to set the default table order to your rowGroup.dataSrc or follow this technique:
    https://datatables.net/extensions/rowgroup/examples/initialisation/fixedOrdering.html

    Kevin

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0

    Ok, It's now working live.datatables.net/cogaluqi/1/edit?html,js,output

    The problem now is that when you click on the dropdown, it order and show the dropdown... What I want is to disable this order (with the arrow...).

    Cordially

  • kthorngrenkthorngren Posts: 20,257Questions: 26Answers: 4,761

    I think the link is to the original not your working version. If you want to eliminate the users ability to sort the table then use columns.orderable like I mentioned above. Or you can look at the example I provided above that allows for sorting and drop down searching:
    http://live.datatables.net/saqozowe/70/edit

    Note that it uses orderCellsTop to move the ordering option to the top header row.

    Kevin

  • LeamsiLeamsi Posts: 8Questions: 1Answers: 0
    edited April 2020

    Hello,

    Here is the correct link: http://live.datatables.net/cogaluqi/4/edit?html,js,output

    I did add "orderable: false". Even with yout technique, I still have the sorting thing. I'm really lost there.

    And thanks again for your help, its very kind :smiley:

    EDIT: I did add "bSort: false,", but the initial problem came back (the edinburg one)..

    EDIT2: I DID IT !!!! I just added "{ orderable: false, targets: '_all' }" and it work !!!!

    Thanks everyone for your help !!!!!!

This discussion has been closed.