0

How to get cell value and row value in ui-grid?

in ng-grid:

 <span ng-click=\"rowClick()\" ng-bind=\"row.getProperty(col.field)\"></span>

Like is there any option ui-grid?

could you please some one suggest Thanks in advance !

3
  • what version of ng-grid are you using? how would you like to access the values? Commented Feb 4, 2016 at 9:57
  • I am using 3.1.0, i am getting the josn data from DB, i need set celltemplate value from json data, could you please let me know, if you have any idea, Thanks in advance ! @sdfacre Commented Feb 4, 2016 at 10:50
  • It's easy: row / rowData.entity.[yourproperty] . With the entity property being a JS object. Commented Jun 7, 2017 at 21:23

1 Answer 1

1

external event: http://ui-grid.info/docs/#/tutorial/301_editableOnFocus

or internal:

if u wanna implement it in inside grid, u should change cellTemplate like that:

<span ng-click=\"grid.appScope.getProperty(row)\"></span>

and define getProperty(...) method

$scope.getProperty = function(rowData){
     console.log(rowData);
}

grid and row - can be used inside template for

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @un.spike, I have one more doubt, in row data i am getting, check box value is Y or N, how to set the value to that check box, if Y, check box need to checked and if it N it not checked, if don't mine you have any example or any idea, could you please share with me, Thanks in advance !
ui-grid.info/docs/#/tutorial/201_editable { name: 'isActive', enableCellEdit: true, type: 'boolean'}, type boolean on colDef field or if u wanna always display the checkbox u need rewrite cellTemplate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.