jQWidgets Forums
jQuery UI Widgets › Forums › Angular › jqxgrid column button not firing event after adding icon over there
Tagged: Angular, angular 2, Button, button clolumn, jqxGrid ;
This topic contains 2 replies, has 2 voices, and was last updated by shakti_singh 7 years, 1 month ago.
-
Author
-
March 28, 2018 at 8:52 am jqxgrid column button not firing event after adding icon over there #99446
Hello, I’m using jqxgrid component. I have a questions.
I have added the buttons in grid. I want to attach an icon to the button instead of just text.
However on adding icon , click event of the button is not firing . Please help !text: ”, datafield: ”, width: 90, cellsalign: ‘center’, columntype: ‘button’,
buttonclick: (row: number): void => {
alert(“Hi”);
},
cellsrenderer: () => {
return ‘<span class=”glyphicon glyphicon-plus”></span>’;
}
`March 28, 2018 at 12:02 pm jqxgrid column button not firing event after adding icon over there #99449Hello shakti,
Here is an example:
app.component.tsimport { Component, ViewEncapsulation } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], encapsulation: ViewEncapsulation.None }) export class AppComponent { source: any = { datatype: 'xml', datafields: [ { name: 'ProductName', type: 'string' }, { name: 'QuantityPerUnit', type: 'int' }, { name: 'UnitPrice', type: 'float' }, { name: 'UnitsInStock', type: 'float' }, { name: 'Discontinued', type: 'bool' } ], root: 'Products', record: 'Product', id: 'ProductID', url: '../assets/sampledata/products.xml' }; dataAdapter: any = new jqx.dataAdapter(this.source); columns: any[] = [ { text: 'Product Name', columngroup: 'ProductDetails', datafield: 'ProductName', width: 250 }, { text: 'Quantity per Unit', columngroup: 'ProductDetails', datafield: 'QuantityPerUnit', cellsalign: 'right', align: 'right' }, { text: 'Unit Price', columngroup: 'ProductDetails', datafield: 'UnitPrice', align: 'right', cellsalign: 'right', cellsformat: 'c2' }, { text: 'Units In Stock', datafield: 'UnitsInStock', cellsalign: 'right', width: 100 }, { text: 'Discontinued', columntype: 'checkbox', datafield: 'Discontinued', align: 'center' }, { text: '', datafield: '', width: 90, cellsalign: 'center', columntype: 'button', cellsrenderer: () => { return '<span class="<span class="glyphicon glyphicon-plus"></span>'; }, buttonclick: (row: number): void => { alert("Hi"); } } ]; }
app.component.css
.jqx-grid-cell input[type="button"] { width: 100%; opacity: 0.01 !important; z-index: 9999 !important; display: block !important; }
Best Regards,
StanislavjQWidgets Team
http://www.jqwidgets.com/March 29, 2018 at 12:08 pm jqxgrid column button not firing event after adding icon over there #99476Hi Stanislav!
Thank you
-
AuthorPosts
You must be logged in to reply to this topic.