How to get each column name (reportName and reportDescription)? Because I push // push all the data into the array as described below.
I use the following code to get the selected row. But it returns null. Can you help me?
//Column.
colModel: [
{display:'WidgetID', name: 'WidgetID', width: 50, sortable: true, align:'left', hide: true },
{display:'Widget Name', name:'WidgetName', width: 170, sortable: true, align :'left' },
{display:'IsClientReport', name:'IsClientReport', width: 50, sortable: false, align:'left', hide: true },
{display: ' ClientReportID', name:'ClientReportID', width: 50, sortable: false, align:'left', hide: true },
{display:'ReportType', name:'ReportType', width: 280, sortable : true, align:'left' }
],
$('#grid01').click(function(event){
$('.trSelected', this ).each( function(){
console.log( 'rowId:' + $(this).attr('id').substr(3) + 'IsClientReport:' + $('td[abbr= "IsClientReport"] >div', this).html() + 'sign:' + $('td[abbr="WidgetID"] >div', this).html() + 'ReportType:' + $(' td[abbr="ReportType"] >div', this).html() );
});
});
Thank you ,
Pon Kumar Pandian
Setting’sortable: false’ on the column will be from the’td’ generated by Flexigrid Delete the’abbr’ attribute. This means that you cannot use the recommended solution to get the selected row.
I modified the flexigrid.js file myself to solve this problem.
If If the column has “name” and has “sortable: true”, Flexigrid previously only added the’abbr’ attribute. I removed the condition of’sortable: true’.
In turn, this also means the column It can always be sorted.
In order to prevent this, I added a’sortable’ attribute, which will only be set when the column is’sortable: true’
After that, I can’t Don’t go through and find all the cases that use’abbr’ as sorting criteria, and replace it with “sortable” check.
That’s it.
I uploaded the file to mediafire, if you just Want to download and use this instead. There are some too many changes in non-specific places, I show my code changes here. If needed, I can provide differences or more explanations. Please note,’sortable: true’ The fix still works for me.
I am new to flexigrid. Can anyone let me know how to get the value of each column selected row.
< /p>
How to get the name of each column (reportName and reportDescription)? Because I push // push all the data into the array as described below.
I use the following code to get the selected row. But it returns null. Can you help me?
//Column.
colModel: [
{display:'WidgetID', name: 'WidgetID', width: 50, sortable: true, align:'left', hide: true },
{display:'Widget Name', name:'WidgetName', width: 170, sortable: true, align :'left' },
{display:'IsClientReport', name:'IsClientReport', width: 50, sortable: false, align:'left', hide: true },
{display: ' ClientReportID', name:'ClientReportID', width: 50, sortable: false, align:'left', hide: true },
{display:'ReportType', name:'ReportType', width: 280, sortable : true, align:'left' }
],
$('#grid01').click(function(event){
$('.trSelected', this ).each( function(){
console.log( 'rowId:' + $(this).attr('id').substr(3) + 'IsClientReport:' + $('td[abbr= "IsClientReport"] >div', this).html() + 'sign:' + $('td[abbr="WidgetID"] >div', this).html() + 'ReportType:' + $(' td[abbr="ReportType"] >div', this).html() );
});
});
Thank you,Pon Kumar Pandian
Not sure if you have figured it out, but I will leave this answer here in case other people in the same situation I have a problem with my question.
Setting’sortable: false’ on the column will remove the’abbr’ attribute from the’td’ generated by Flexigrid. This means that you cannot use the recommended Solution to get the selected row.
I modified the flexigrid.js file myself to solve this problem.
If the column has “name” and has “sortable: true”, then Flexigrid previously only added the’abbr’ attribute. I removed the condition of’sortable: true’.
In turn, this also means that the columns can always be sorted.
In order to prevent this , I added a’sortable’ attribute, which will only be set when the column is’sortable: true’
After that, I have to go through and find all the cases where’abbr’ is used as the sort condition , And replace it with a “sortable” check.
That’s it.
I uploaded the file to mediafire, if you just want to download and use this instead. There is no specific place Some too many changes, I show my code changes here. If needed, I can provide differences or more explanation. Please note that’sortable: true’ still applies to my fix.
p>