jQuery UI Widgets › Forums › DataTable › getCellValue returns empty string for a cell having a button inside
Tagged: getCellValue;button;
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 9 years, 4 months ago.
-
Author
-
December 22, 2015 at 1:22 pm getCellValue returns empty string for a cell having a button inside #79662
Dear JQX,
I have setup a jqx table like this,$('#uda-setup-manage-table').jqxDataTable({ altRows: true, sortable: true, width: '100%', selectionMode: 'singleRow', editable: false, columns: [ {text: 'Setup Name', dataField: 'Setup Name', width: '17%'}, {text: 'Usage Data Files', dataField: 'Usage Data Files', width: '17%'}, {text: 'Number of Points', dataField: 'Number of Points', width: '17%'}, {text: 'Parameters', dataField: 'Parameters', width: '17%'}, {text: 'Date', dataField: 'Date', width: '17%'}, {text: 'Associated', cellsAlign: 'center', align: "center", width: '5%', columnType: 'none', sortable: false, dataField: "Associated", cellsRenderer: function (row, column, value) { // render custom column. return '<button type="button" class="btn btn-success" aria-label="Left Align">\n\ <span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>\n\ </button>'; } }, {text: 'Edit', cellsAlign: 'center', align: "center", width: '5%', columnType: 'none', sortable: false, dataField: "Edit", cellsRenderer: function (row, column, value) { // render custom column. return '<button type="button" class="btn btn-success" aria-label="Left Align">\n\ <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>\n\ </button>'; } }, {text: 'Delete', cellsAlign: 'center', align: "center", width: '5%', columnType: 'none', sortable: false, dataField: "Delete", cellsRenderer: function (row, column, value) { // render custom column. return '<button type="button" class="btn btn-danger" aria-label="Left Align">\n\ <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>\n\ </button>'; } }, { text: "Row Status", dataField: "Row Status", hidden: true } ] });
now when I run this
$('#uda-setup-manage-table').jqxDataTable('getCellValue', 0, 'Associated');
I am getting empty string,
can you help me to get the button please.thanks
SumitDecember 22, 2015 at 1:48 pm getCellValue returns empty string for a cell having a button inside #79663Hi SumitRoy,
“getCellValue” returns the data bound cell value. In your case, you do not have such. You have a button which you cannot get. If you want to render buttons into jqxDataTable, please follow this approach: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxdatatable/javascript-datatable-command-column.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/December 23, 2015 at 3:59 am getCellValue returns empty string for a cell having a button inside #79682Hi Peter Steov,
I saw the link and it is using JSON data,
but my requirements is say, if I have HTML Based table having buttons in some cell, and I want to wrap the entire table using jqxDataTable as
$('#uda-setup-manage-table').jqxDataTable({//some code});
where theuda-setup-manage-table
is a HTML Table’s IDnow after wrapping/transforming it into jqxDataTable how can get the buttons ?
is there any such way ?December 23, 2015 at 11:50 am getCellValue returns empty string for a cell having a button inside #79709Hi SumitRoy,
The only way to get Buttons is the shown in our demo. You can’t load HTML Table tag which has anything else than Text inside.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.