I have a table that has the extension resize disables some columns and I use the method $table.bootstrapTable('getData')
I want to get a JSon with the remaining columns but the method brings all the columns. as it would be to bring only the visible columns. Then pass it to Google Chart.
table bootstrap: link
<table id="table"
data-toggle="table"
data-url="/Admin/ListSelect"
data-show-export="true"
data-pagination="true"
data-resizable="true"
data-click-to-select="true"
data-toolbar="#toolbar"
data-height="480"
data-show-columns="true"
data-search="true"
data-flat="true"
data-show-multi-sort="true"
data-sort-priority='[{"sortName": "Nombre","sortOrder":"desc"},{"sortName":"Focus","sortOrder":"desc"}]'
data-filter-control="true"
data-filter-show-clear="true">
<thead>
<tr>
@foreach (var aa in new AuxAudit().GetType().GetProperties())
{
<th data-field= @aa.Name data-sortable="true"> @aa.Name</th>
}
</tr>
</thead>
</table>
<button id="button" class="btn btn-default">getData</button>
<div id="chart_div"></div>
<script type="text/javascript">
function LoadChart() {
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
}
function drawChart() {
var jsonData = JSON.stringify($('#table').bootstrapTable('getData'));
var data = new google.visualization.DataTable(jsonData);
var options = {'title':'Auditoria',
'width':400,
'height':300};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}