AngularJs ui-grid onRowSelectionChanged is not updating variable value, always it has default value









up vote
1
down vote

favorite












it worked fine last time i check(two or three months ago) their is a variable called with the default boolean value false like below.



$scope.IsRowSelected = false;


And i should mention when the debugger runs on first time value set as true.
But it come to delete function then the value reads the default value. i cant understand how to handle this error.



code is below :






 $scope.IsRowSelected = false;

$scope.gridOptions.onRegisterApi = function (gridApi)
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row)
//$scope.selectedEmpID = row.entity.id;
debugger;
$scope.selectedEntity = row.entity;
$scope.Check = true;
$scope.IsRowSelected = true;
//in here it shows IsRowSelected as true
);


$scope.DeleteEntity = function ()
debugger;
//when this funtion excecute the IsRowSelected = false
if ($scope.IsRowSelected == true)
var selectedRow = $scope.selectedEntity;
















share|improve this question























  • try using $timeout(function() $scope.IsRowSelected = true; )
    – Vikram Singh
    Nov 9 at 5:27











  • still it's not working
    – Tharindu Dissanayaka
    Nov 9 at 5:41










  • i had check with backup and its working.Their are no any changes between two codes.Still i unable to find the issue
    – Tharindu Dissanayaka
    Nov 9 at 6:03















up vote
1
down vote

favorite












it worked fine last time i check(two or three months ago) their is a variable called with the default boolean value false like below.



$scope.IsRowSelected = false;


And i should mention when the debugger runs on first time value set as true.
But it come to delete function then the value reads the default value. i cant understand how to handle this error.



code is below :






 $scope.IsRowSelected = false;

$scope.gridOptions.onRegisterApi = function (gridApi)
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row)
//$scope.selectedEmpID = row.entity.id;
debugger;
$scope.selectedEntity = row.entity;
$scope.Check = true;
$scope.IsRowSelected = true;
//in here it shows IsRowSelected as true
);


$scope.DeleteEntity = function ()
debugger;
//when this funtion excecute the IsRowSelected = false
if ($scope.IsRowSelected == true)
var selectedRow = $scope.selectedEntity;
















share|improve this question























  • try using $timeout(function() $scope.IsRowSelected = true; )
    – Vikram Singh
    Nov 9 at 5:27











  • still it's not working
    – Tharindu Dissanayaka
    Nov 9 at 5:41










  • i had check with backup and its working.Their are no any changes between two codes.Still i unable to find the issue
    – Tharindu Dissanayaka
    Nov 9 at 6:03













up vote
1
down vote

favorite









up vote
1
down vote

favorite











it worked fine last time i check(two or three months ago) their is a variable called with the default boolean value false like below.



$scope.IsRowSelected = false;


And i should mention when the debugger runs on first time value set as true.
But it come to delete function then the value reads the default value. i cant understand how to handle this error.



code is below :






 $scope.IsRowSelected = false;

$scope.gridOptions.onRegisterApi = function (gridApi)
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row)
//$scope.selectedEmpID = row.entity.id;
debugger;
$scope.selectedEntity = row.entity;
$scope.Check = true;
$scope.IsRowSelected = true;
//in here it shows IsRowSelected as true
);


$scope.DeleteEntity = function ()
debugger;
//when this funtion excecute the IsRowSelected = false
if ($scope.IsRowSelected == true)
var selectedRow = $scope.selectedEntity;
















share|improve this question















it worked fine last time i check(two or three months ago) their is a variable called with the default boolean value false like below.



$scope.IsRowSelected = false;


And i should mention when the debugger runs on first time value set as true.
But it come to delete function then the value reads the default value. i cant understand how to handle this error.



code is below :






 $scope.IsRowSelected = false;

$scope.gridOptions.onRegisterApi = function (gridApi)
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row)
//$scope.selectedEmpID = row.entity.id;
debugger;
$scope.selectedEntity = row.entity;
$scope.Check = true;
$scope.IsRowSelected = true;
//in here it shows IsRowSelected as true
);


$scope.DeleteEntity = function ()
debugger;
//when this funtion excecute the IsRowSelected = false
if ($scope.IsRowSelected == true)
var selectedRow = $scope.selectedEntity;












 $scope.IsRowSelected = false;

$scope.gridOptions.onRegisterApi = function (gridApi)
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row)
//$scope.selectedEmpID = row.entity.id;
debugger;
$scope.selectedEntity = row.entity;
$scope.Check = true;
$scope.IsRowSelected = true;
//in here it shows IsRowSelected as true
);


$scope.DeleteEntity = function ()
debugger;
//when this funtion excecute the IsRowSelected = false
if ($scope.IsRowSelected == true)
var selectedRow = $scope.selectedEntity;









 $scope.IsRowSelected = false;

$scope.gridOptions.onRegisterApi = function (gridApi)
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row)
//$scope.selectedEmpID = row.entity.id;
debugger;
$scope.selectedEntity = row.entity;
$scope.Check = true;
$scope.IsRowSelected = true;
//in here it shows IsRowSelected as true
);


$scope.DeleteEntity = function ()
debugger;
//when this funtion excecute the IsRowSelected = false
if ($scope.IsRowSelected == true)
var selectedRow = $scope.selectedEntity;










javascript angularjs angular-ui-grid ui-grid






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 8:10









Mark

2,6961722




2,6961722










asked Nov 9 at 5:15









Tharindu Dissanayaka

63




63











  • try using $timeout(function() $scope.IsRowSelected = true; )
    – Vikram Singh
    Nov 9 at 5:27











  • still it's not working
    – Tharindu Dissanayaka
    Nov 9 at 5:41










  • i had check with backup and its working.Their are no any changes between two codes.Still i unable to find the issue
    – Tharindu Dissanayaka
    Nov 9 at 6:03

















  • try using $timeout(function() $scope.IsRowSelected = true; )
    – Vikram Singh
    Nov 9 at 5:27











  • still it's not working
    – Tharindu Dissanayaka
    Nov 9 at 5:41










  • i had check with backup and its working.Their are no any changes between two codes.Still i unable to find the issue
    – Tharindu Dissanayaka
    Nov 9 at 6:03
















try using $timeout(function() $scope.IsRowSelected = true; )
– Vikram Singh
Nov 9 at 5:27





try using $timeout(function() $scope.IsRowSelected = true; )
– Vikram Singh
Nov 9 at 5:27













still it's not working
– Tharindu Dissanayaka
Nov 9 at 5:41




still it's not working
– Tharindu Dissanayaka
Nov 9 at 5:41












i had check with backup and its working.Their are no any changes between two codes.Still i unable to find the issue
– Tharindu Dissanayaka
Nov 9 at 6:03





i had check with backup and its working.Their are no any changes between two codes.Still i unable to find the issue
– Tharindu Dissanayaka
Nov 9 at 6:03













1 Answer
1






active

oldest

votes

















up vote
0
down vote













gridApi.selection.on.rowSelectionChanged function call when row is getting unselect, set noUnselect property to true,so row cant be unselected.



$scope.gridApi.selection.getSelectedRows();


use this code to get the selected row from the grid.



Working Fiddle






share|improve this answer






















  • its not working.
    – Tharindu Dissanayaka
    Nov 9 at 8:26










  • jsfiddle.net/h5p4mbvL here is the working fiddle
    – sridhar rajendran
    Nov 9 at 9:54










  • thanks for your help.
    – Tharindu Dissanayaka
    Nov 9 at 10:14











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53220231%2fangularjs-ui-grid-onrowselectionchanged-is-not-updating-variable-value-always-i%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













gridApi.selection.on.rowSelectionChanged function call when row is getting unselect, set noUnselect property to true,so row cant be unselected.



$scope.gridApi.selection.getSelectedRows();


use this code to get the selected row from the grid.



Working Fiddle






share|improve this answer






















  • its not working.
    – Tharindu Dissanayaka
    Nov 9 at 8:26










  • jsfiddle.net/h5p4mbvL here is the working fiddle
    – sridhar rajendran
    Nov 9 at 9:54










  • thanks for your help.
    – Tharindu Dissanayaka
    Nov 9 at 10:14















up vote
0
down vote













gridApi.selection.on.rowSelectionChanged function call when row is getting unselect, set noUnselect property to true,so row cant be unselected.



$scope.gridApi.selection.getSelectedRows();


use this code to get the selected row from the grid.



Working Fiddle






share|improve this answer






















  • its not working.
    – Tharindu Dissanayaka
    Nov 9 at 8:26










  • jsfiddle.net/h5p4mbvL here is the working fiddle
    – sridhar rajendran
    Nov 9 at 9:54










  • thanks for your help.
    – Tharindu Dissanayaka
    Nov 9 at 10:14













up vote
0
down vote










up vote
0
down vote









gridApi.selection.on.rowSelectionChanged function call when row is getting unselect, set noUnselect property to true,so row cant be unselected.



$scope.gridApi.selection.getSelectedRows();


use this code to get the selected row from the grid.



Working Fiddle






share|improve this answer














gridApi.selection.on.rowSelectionChanged function call when row is getting unselect, set noUnselect property to true,so row cant be unselected.



$scope.gridApi.selection.getSelectedRows();


use this code to get the selected row from the grid.



Working Fiddle







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 9 at 9:55

























answered Nov 9 at 6:27









sridhar rajendran

87




87











  • its not working.
    – Tharindu Dissanayaka
    Nov 9 at 8:26










  • jsfiddle.net/h5p4mbvL here is the working fiddle
    – sridhar rajendran
    Nov 9 at 9:54










  • thanks for your help.
    – Tharindu Dissanayaka
    Nov 9 at 10:14

















  • its not working.
    – Tharindu Dissanayaka
    Nov 9 at 8:26










  • jsfiddle.net/h5p4mbvL here is the working fiddle
    – sridhar rajendran
    Nov 9 at 9:54










  • thanks for your help.
    – Tharindu Dissanayaka
    Nov 9 at 10:14
















its not working.
– Tharindu Dissanayaka
Nov 9 at 8:26




its not working.
– Tharindu Dissanayaka
Nov 9 at 8:26












jsfiddle.net/h5p4mbvL here is the working fiddle
– sridhar rajendran
Nov 9 at 9:54




jsfiddle.net/h5p4mbvL here is the working fiddle
– sridhar rajendran
Nov 9 at 9:54












thanks for your help.
– Tharindu Dissanayaka
Nov 9 at 10:14





thanks for your help.
– Tharindu Dissanayaka
Nov 9 at 10:14


















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53220231%2fangularjs-ui-grid-onrowselectionchanged-is-not-updating-variable-value-always-i%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

Node.js puppeteer - Use values from array in a loop to cycle through pages