javascript - SlickGrid onSelectedRowsChanged not firing -


i have following issue slickgrid:

  1. left click row 1 (onselectedrowschanged fires expected)
  2. hold down control button
  3. left click row 2 (onselectedrowschanged fires expected)
  4. left click row 1 (onselectedrowschanged fires expected)
  5. let go of control button
  6. click row 1 (onselectedrowschanged not fire! if click on same row 1 cell before)

issues described on step 6 above. here link jsfiddler showing issues: http://jsfiddle.net/fortesl/olj8otsj/1/

code attached:

         var grid;      var data = [];      var columns = [{          id: "title",          name: "title",          field: "title",          width: 300,          selectable: false,          resizable: false      }, {          id: "priority",          name: "priority",          field: "priority",          width: 200,          selectable: false,          resizable: false      }];       var options = {          editable: true,          enableaddrow: true,          enablecellnavigation: true,          forcefitcolumns: true,          autoedit: false      };       (var = 0; < 100; i++) {          var d = (data[i] = {});          d["title"] = "task " + (i + 1);          d["priority"] = "medium";      }       grid = new slick.grid("#mygrid", data, columns, options);       grid.setselectionmodel(new slick.rowselectionmodel());       grid.onselectedrowschanged.subscribe(function () {          var selectedrows = grid.getselectedrows();          (var = 0; < selectedrows.length; i++) {              selectedrows[i] = selectedrows[i] + 1;          }          $('.selected-rows')[0].innerhtml = selectedrows;      });      grid.onclick.subscribe(function () {          $('.selected-rows')[0].innerhtml = '';      }); 

please help

i solved issue handling onclick event , calling setselectedrows handler. shown below:

                grid.onclick.subscribe(function(e) {                 var cell = $scope.grid.getcellfromevent(e);                 var row = (cell) ? cell.row : 0;                 var rows = [row];                 grid.setselectedrows(rows);             }); 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -