how to select certain rows and tag them

how to select certain rows and tag them

umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

I have 1000 rows table ; i need a way to select certain rows and tag them as reference rows. and certain other rows as target rows. insert the first column with that information. say if I selected 1,3,7,10 as my reference rows and 2,4,5,6 as my target rows. I want the new first column to show that Tag name.
for example in this testcase http://live.datatables.net/xilamifu/1/edit
the selection criteria is like get all office=london and tag them as reference get all office=san francisco rows and tag them as target. so selection button should take office or salary or any other column dynamically by user choice. they can use any column information to select.
when i view the complete page it should have first column (Tag column) of those rows marked Reference or Target or empty ie no tag.
I tried to insert Tag column i got check-box but it is overwritten by Name. I want to select boxes there one for reference and one for target. and depending on tag those check-boxes should get checked.
Can you please help me in achieving this.
As of now, i made a simple page where there is no tag column, but i select only one row as reference and another row as tag and compare those two rows. but I want to do multiple comparisons with this selection mechanism.
your help is greatly appreciated.

thanks,
Uma-

Answers

  • umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

    I have 1000 rows table ; i need a way to select certain rows and tag them as reference rows. and certain other rows as target rows. insert the first column with that information. say if I selected 1,3,7,10 as my reference rows and 2,4,5,6 as my target rows. I want the new first column to show that Tag name.
    **for example in this testcase http://live.datatables.net/xilamifu/1/edit
    **the selection criteria is like get all office=london and tag them as reference get all office=san francisco rows and tag them as target. so selection button should take office or salary or any other column dynamically by user choice. they can use any column information to select.
    when i view the complete page it should have first column (Tag column) of those rows marked Reference or Target or empty ie no tag.
    I tried to insert Tag column i got check-box but it is overwritten by Name. I want to select boxes there one for reference and one for target. and depending on tag those check-boxes should get checked.
    Can you please help me in achieving this.
    As of now, i made a simple page where there is no tag column, but i select only one row as reference and another row as tag and compare those two rows. Here is the **example: http://live.datatables.net/gavelefa/2/edit** but I want to do multiple comparisons with this selection mechanism.
    your help is greatly appreciated.

    thanks,
    Uma-

  • colincolin Posts: 12,481Questions: 0Answers: 2,117

    I'm not following, I'm afraid, but this example shows how to use checkboxes with the Select extension extension,

    Colin

  • umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

    Hi Colin,

    yes, here I can select using checkboxes, but I want a way to select using a form or something, where in the form i say office=london & position=technician the checkboxes of the rows where office=london&position=technician should get checked.
    similar when I say office=sanfrancisco& salary<100,000 those rows checkboxes should get selected. Hope it is clear. I have very basic example where I can manually click and select those rows, but I want an easier way to select when user can give some selection criteria and then those rows get selected and Tagged.

    thanks,
    Uma-

  • umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

    What I want to achieve is an easier way for user, instead of clicking 100s of manual checkbox clickings for speific rows.

  • colincolin Posts: 12,481Questions: 0Answers: 2,117

    It would be worth looking at rows().every(), as you can do things like this : http://live.datatables.net/ganepebu/1/edit - where clicking the button selects all rows where Office == London.

    Colin

  • umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

    thanks Colin for the reply. But that button kind of selection will be too hard. we may have several combinations of it as I was saying it can be office=london & position=technician. what I was thinking is if we add filtering mechanism and then Tag.

  • kthorngrenkthorngren Posts: 13,606Questions: 25Answers: 3,204

    Sounds like you want a solution like SearchBuilder but instead of filtering the table you want to highlight/select the matched rows instead. Does this sound accurate?

    Kevin

  • umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

    thanks Kevin for the reply. yes, the description you said matching . do you have an example page to see what it does? yes select those rows and add a Tag to those selected rows. once the tag added i can use those selected rows and show some comparisons etc.

  • kthorngrenkthorngren Posts: 13,606Questions: 25Answers: 3,204

    There aren't any examples doing what you want. Colin's example shows how to loop through all the rows to select rows based on a condition. You can also add the tags with the same condition. You can check for multiple conditions if needed. You will need to build your input form to support the types of searches you want to perform. This example shows how to collect the column data to build select lists.

    Kevin

  • umaeswaraumaeswara Posts: 68Questions: 12Answers: 0

    Hi Kevin, I saw this example https://datatables.net/extensions/searchbuilder/examples/initialisation/simple.html . I will explore it more.

Sign In or Register to comment.