Author Topic: Get Row ID of checkboxes Problem  (Read 81 times)

necatiozbek

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 18
    • View Profile
Get Row ID of checkboxes Problem
« on: July 15, 2024, 01:48:57 am »
Hi
AngularJs 1.82  I am working in a javascript file
My Software ParamQuery_Pro_9.1.1 ,
I can't get IDs of separated rows via checkbox..

https://paramquery.com/pro/demos/checkbox_id  > I am doing the example in this link, it did not work.

It's important to me that I'm solving this issue.

My grid settings are as follows:
The only difference between me and the examples is that I load the data later using a different method.
If I do not load the data later, Ids appear as in your example.

(function (angular) {
    "use strict";
    angular
        .module("MayyApp", ['ngCookies', 'ui-notification'])
        .controller("FaturalarController", ['$scope', '$http', '$cookies', '$filter', '$window', 'Notification', 'EkranAyarlari',
            function ($scope, $http, $cookies, $filter, $window, Notification, EkranAyarlari) {
                var vm = this;
.
.
.

var obj = {
       height: faturalistesi_height,
       colModel:
                            [
                                    {
                                    dataIndx: "state", maxWidth: 30, minWidth: 30, align: "center", resizable: false,
                                    title: "",
                                    menuIcon: false,
                                    type: 'checkBoxSelection', cls: 'ui-state-default', sortable: false, editor: false,
                                    dataType: 'bool',
                                    cb: {
                                        all: false,  //checkbox selection in the header affect current page only.
                                        header: true //show checkbox in header.
                                    }
                                },
                                { title: "ID", width: 100, dataType: "integer", dataIndx: "ID_FATURA" },
}],
   editable: true,
   resizable: true,
   wrap: false,
   numberCell: { show: true },
   filterModel: {
                            on: true,
                            mode: "AND",
                            header: true,
                            menuIcon: true
   },
   selectionModel: {type:'row',mode:'block'},
   pasteModel: { on: false },
   toolbar: {
               items: [
                                {
                                    type: 'button',
                                    label: 'Get Row ID of checkboxes',
                                    listener: function ()
                                    {
                                        var checked = this.Checkbox('state').getCheckedNodes().map(function (rd) {
                                            return rd.id
                                        })
                                        alert(checked);
                                    }
                                }
                           ]
                  }

};

// My Data Bind Other method:
vm.FillGridFaturalar = function () {


                    $http.post("/Faturalar/GetAll_Faturalar/", { filtreler: vm.FiltreKriterleri }).then(function (result) {

                          if (result.data === null) {
                           
                            return;
                        }
                        else {

                                 var checkft= $("#grid_checkbox");
                                 checkft.pqGrid("option", "dataModel", { data: result.data });
                                checkft.pqGrid("refreshDataAndView");

                         }

                    }, vm.onError);
}



}])

})(angular);

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: Get Row ID of checkboxes Problem
« Reply #1 on: July 15, 2024, 11:08:30 am »
Please update your code as per reply to your next post to resolve it and kindly let me know if you still face issues.