Can I get the Group Index Number of single selected row?

Can I get the Group Index Number of single selected row?

aftab ahmedaftab ahmed Posts: 5Questions: 2Answers: 0

Can I get the Group Index Number of single selected row?

what I want is to disable the selection for other groups, if a user select one row of group, he can only select the Rows of that group only,

I just want the group index of selected row.

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Just to check, is this referring to RowGroup? You can't prevent selects, but you could toggle it back through the API. If you can confirm, then I can add more,

    Colin

  • aftab ahmedaftab ahmed Posts: 5Questions: 2Answers: 0

    yes i am using RowGroup

    What i mean is i want a Group id of each row in endRender so that i append it in each row as data-groupnumber

  • aftab ahmedaftab ahmed Posts: 5Questions: 2Answers: 0
    edited August 2021

    endRender: function (rows, group) { jobSummaryRowGroupNumber++; rows.nodes().each((tr,y) => { $(tr).attr('data-groupnumber', jobSummaryRowGroupNumber) }) }

  • aftab ahmedaftab ahmed Posts: 5Questions: 2Answers: 0

    for now i am use counter which is not the good way i think.

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736

    I don't understand why you need to generate an index. Can you use the value of the rowGroup.dataSrc column to keep track of group when the row is selected?

    Maybe you can provide a simple test case showing what you are trying to do so we can offer suggestions.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.