using checkboxes for row selection

3 posts, 1 answers
  1. Joe
    Joe avatar
    155 posts
    Member since:
    May 2012

    Posted 31 Jan Link to this post

    I'm putting together a grid which displays results for a document search.  In the grid itself, instead of showing the row Id, I have a checkbox.  What I'd like to do is twofold:

    1. Add a check box column header that'll select all rows when checked (I've seen examples that use a specific boolean field, which my grid doesn't have nor use...  I just want to go through each row displayed and check the checkbox, but it is not dependent upon any other column.

    2. Get all the selected row IDs to pass into a controller.  Not really pertinent, but what that controller will do is look for corresponding rows in the database, extract the document information in order to zip them all up together.

    Any help would be greatly appreciated...

  2. Answer
    Dimo avatar
    8385 posts

    Posted 02 Feb Link to this post

    Hi Joe,

    An example showing a header cell checkbox is available at:

    My understanding is that the checked rows will also be selected. From this point of view, you can obtain the selected rows, obtain the underlying data item for each of them, and finally, get the desired IDs.

    - how to obtain the selected rows

    - how to obtain the data item for a specific table row

    - how to get a data field value from a data item object

    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Joe
    Joe avatar
    155 posts
    Member since:
    May 2012

    Posted 02 Feb in reply to Dimo Link to this post

    Thank you...  this was exactly what I was looking for...

    $("#docResults tbody input:checkbox").prop("checked", this.checked);


    Everything else I had, but this one this eluded me...  Unfortunately I'm not a javascript expert, so trying to determine the class name of CSS tags of nested components to get what I need sometimes eludes me...

    Thank you again.

Back to Top