You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So first off I tried the different options shown in this thread to no avail: #16
My issue is that I have a drop down box with values [20,50,75,100] and an ID of 'per_page_drop'. When I load the page I call: function tableData() { var e = document.getElementById("per_page_drop"); var value = e.options[e.selectedIndex].value; alert(parseInt(value)); var tabs = document.getElementById("my_table"); tabs.setAttribute('data-page-size',value); }; tableData();
This sends an alert letting me know the default value of the box (I have it defaulting to 20) and sets the data-page-size attribute on my table to the value of the dropdown box. On the initial load no matter what I have the box defaulting to it sets the corresponding rows to that amount. So if I have a default of 50, the rows shown is 50, if its 20 it shows 20.
My issue is that when I change the value in the box the rows do not update. I use onChange() for the dropdown box to reference the tableData() function above. I have also tried to use: $('.footable').trigger('footable_initialized'); $('table').data('footable').redraw(); $('table').trigger('footable_resize'); $('table').trigger('footable_redraw');
The alert, just like on the load, calls the new amount in the select box. I have an element on my page that shows the milliseconds of GETS POSTS PUTS and UPDATES takes. It is showing 900 milliseconds, meaning it "seems" to be redrawing the table. However, the row amounts do not change from say 20 to 50. Any ideas as to what I'm missing?
Oh also I have tried to wrap the call in ajax like so:
function tableData() { $.ajax({ url : '/', success : function() { var dropdown = document.getElementById("per_page_drop"); var value = dropdown.options[dropdown.selectedIndex].value; alert(parseInt(value)); var params = {"data-page-size":"value"}; var tabs = document.getElementById("my_table"); tabs.setAttribute('data-page-size',value); $('table').data('footable').redraw(); $('table').trigger('footable_resize'); $('table').trigger('footable_redraw'); } }); };
How can I change the data row value and reload the table to show the new amount of rows? Thanks and thanks for amazing plugin!
The text was updated successfully, but these errors were encountered:
Also, I just checked the Chrome source and I can see the data-page-size attribute change when I select a new value in the drop down box.
So from: data-page-size="20" to data-page-size="50" etc etc
So first off I tried the different options shown in this thread to no avail: #16
My issue is that I have a drop down box with values [20,50,75,100] and an ID of 'per_page_drop'. When I load the page I call:
function tableData() { var e = document.getElementById("per_page_drop"); var value = e.options[e.selectedIndex].value; alert(parseInt(value)); var tabs = document.getElementById("my_table"); tabs.setAttribute('data-page-size',value); }; tableData();
This sends an alert letting me know the default value of the box (I have it defaulting to 20) and sets the data-page-size attribute on my table to the value of the dropdown box. On the initial load no matter what I have the box defaulting to it sets the corresponding rows to that amount. So if I have a default of 50, the rows shown is 50, if its 20 it shows 20.
My issue is that when I change the value in the box the rows do not update. I use onChange() for the dropdown box to reference the tableData() function above. I have also tried to use:
$('.footable').trigger('footable_initialized');
$('table').data('footable').redraw();
$('table').trigger('footable_resize');
$('table').trigger('footable_redraw');
The alert, just like on the load, calls the new amount in the select box. I have an element on my page that shows the milliseconds of GETS POSTS PUTS and UPDATES takes. It is showing 900 milliseconds, meaning it "seems" to be redrawing the table. However, the row amounts do not change from say 20 to 50. Any ideas as to what I'm missing?
Oh also I have tried to wrap the call in ajax like so:
function tableData() { $.ajax({ url : '/', success : function() { var dropdown = document.getElementById("per_page_drop"); var value = dropdown.options[dropdown.selectedIndex].value; alert(parseInt(value)); var params = {"data-page-size":"value"}; var tabs = document.getElementById("my_table"); tabs.setAttribute('data-page-size',value); $('table').data('footable').redraw(); $('table').trigger('footable_resize'); $('table').trigger('footable_redraw'); } }); };
How can I change the data row value and reload the table to show the new amount of rows? Thanks and thanks for amazing plugin!
The text was updated successfully, but these errors were encountered: