ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Row expand on click of celltemplate, UI-Grid in Angular JS

Open kaavya07 opened this issue 10 years ago • 5 comments

Hi All,

I would like to expand the row on click of celltemplate data instead of Plus Sign.

Please help.

Please see image below. Its expanding on click of Plus Sign but wanted it to be from click of Jobname. image

kaavya07 avatar Aug 09 '16 09:08 kaavya07

write a row template with a callback function into your controller/directive which would take the row and use row expansion api to do the rest..

angular-git-user avatar Aug 16 '16 05:08 angular-git-user

Below is the cell template I used to done the same thing:

var cellTemplate = '<div ng-click="grid.api.expandable.toggleRowExpansion(row.entity)" class="ui-grid-cell-contents" title="TOOLTIP">{{COL_FIELD CUSTOM_FILTERS}}</div>';

AdrianToman1 avatar Dec 16 '16 00:12 AdrianToman1

Can have a look so it might help u for your question asked http://plnkr.co/edit/YnLVEUS4gmZWXjgsNXdU?p=preview

manjunathmofs avatar Aug 18 '17 14:08 manjunathmofs

@magnusakselvoll using v4.0.7 the event is fired too in the [+] icon solved like this

if (event.target.localName === 'div')

if someone is using typescript, the event param is (parameter) event: angular.IAngularEvent you can access with

// plain js
event['target']['localName']
// or lodash
_.at(event as any, 'target.localName');
// or change event type declaration
event:any

vcollado avatar Oct 11 '17 14:10 vcollado

how to change the color of row selection

maychine-fatima avatar Apr 10 '18 14:04 maychine-fatima