question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i make select row and selectall using with checkbox?

See original GitHub issue

Hi! I want to create selectall column using with checkbox. But i’m not handle selectrow data. How can i do?

$scope.dtOptions = DTOptionsBuilder.newOptions()
                   .withOption("ajax", {
                       url: "api/ListApiController/GetList",
                       type: "POST"
                   })
                   .withDataProp("data")
                });

$scope.dtColumns = [
                DTColumnBuilder.newColumn("Selected")
                    .withTitle("<input type='checkbox' class='group-checkable' data-set='.checkboxes' />")
                    .notSortable().withOption("searchable", false)
                    .renderWith(function (data) {
                        if (data) {
                            return "<input type='checkbox' checked='checked' class='checkboxes' name='Id' value='" + data + "'/>";
                        } else {
                            return "<input type='checkbox' class='checkboxes' name='Id' value='" + data + "'/>";
                        }
                    }).withClass("text-center"),
                DTColumnBuilder.newColumn("Column2").notSortable().withTitle("Column2"),

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
blueecommented, Oct 15, 2015

I also noticed that headerCallback didn’t work for me. I learned that it had to be called exactly two times for it to work. If to call $compile only once then ng-click would not work in the header, if call $compile more than twice then ng-click would be called x-number of times.

.withOption('headerCallback', function (header) {

    if (!$scope.dtOpts.counter)
        $scope.dtOpts.counter = 1;
    else
        $scope.dtOpts.counter = $scope.dtOpts.counter + 1;

    if ($scope.dtOpts.counter <= 2)
        $compile(angular.element(header).contents())($scope);
})
1reaction
eliseguimaraescommented, Sep 29, 2016

Hi, @srkdk, my way was implemented on angular! It works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select All Checkbox using Select Extension - DataTables
You can create a select all checkbox then use rows().select() and rows().deselect() to select or deselect all rows depending on the state fo...
Read more >
Row Selection by clicking only checkbox and not anywhere ...
1 Answer 1 · 01 Select row by first TD element: You will need to be able to click on the first <td>...
Read more >
How to create a "Select All" checkbox - Educative.io
Loop through the checkboxes using a for loop · If the “select all” checkbox is indeed checked. Highlight all table rows · When...
Read more >
IR rows on "select all" option into collection — oracle-tech
Hello. We are using Oracle Apex 21.2.6. We are trying to fill a collection when user clicks on Interactive Report checkboxes.
Read more >
Row Selection - Grid - Kendo UI for Angular - Telerik
Single Row Selection; Multiple Rows Selection; Checkboxes-Only Selection; Select-All Checkbox. The following example demonstrates the row selection in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found