New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with ajax #16
Comments
Hi, |
Hey guys, once footable is initialized, a specific class name is added to the table and then when footable is called again on the table it checks for that class name and if it exists then it does nothing (cause it assumes footable has already run on that table). One way around this is to pull back the entire table in your ajax response and running the $(table).footable(); code on it when the ajax call is complete. But I am wanting to add a new option so you can call something like: $(table).footable({forceRefresh:true}); So you wont need to get the entire table back from ajax call, cause maybe you just want to add some rows to the existing table or paginate the existing table |
That what I thought. An option to refresh the table would be nice. Great work Bradvin, the plugin looks very promising! |
Hello guys, I called $(table).footable(); after the ajax call and it's working now. The plugin is very promising indeed, Thank you Bradvin!!! |
I am using footable-0.1. After update, the footable magic breaks and calling footable() again doesn't help. Is footable-0.5 having same issue? jQuery('.footable').removeClass('footable-loaded').footable() doesn't help. |
Please upgrade to 0.5 There is an event in 0.5: "footable_initialized" which you must trigger on the table, rather then trying to removeClass and re-init footable. Doing a reinit like you are doing will only cause issues and is not recommended at all. rather do the following: jQuery('.footable').trigger('footable_initialized'); |
Installed version 0.5 and called jQuery('.footable').trigger('footable_initialized'); The row didn't shrink as expected. |
You are right - I have setup a new AJAX demo and got the same issue as you. I have fixed the issue and will commit those changes as soon as I have tested everything I will post here again after the commit |
ok, will be very grateful to have this :) In June I deploy new version of our app to production. |
Hi, I have noticed that I have an issue when I trigger footable_initialized - $('#table').trigger('footable_initialized'); |
I'm having the same issue as @lilith712. $('.footable').trigger('footable_initialized') causes the error mentioned above. Using $('.footable').trigger('footable_resize') does not cause an error. However, neither method appears to resize the table to the original specified page size. After adding new rows via AJAX, the current page gets larger. Clicking a sortable column does trigger the table to resize properly. |
@lilith712 @bradkeys please can you try the V2 branch out - I have been making a lot of changes to that branch and as soon as I have completed all the demos and docs, I will be merging it back into master |
Actually I have been trying it out the V2 branch all night. Event interception and being able to do this table.trigger('footable_setup_paging'); is definitely key to making this work with paginated AJAX requests. Thanks a lot and keep up the great work. |
@bradkeys were you successful in getting the $('.footable').trigger('footable_initialized') to work with the V2? I was not able to and still get the same error. footable_resize also did not work for me. |
@uvadoug2 Yup it worked just fine for me back then after switching to V2. Perhaps something has changed since. I stopped using FooTable and am now using Bootstrap 3 with AngularJS to do what we need. |
I had a similar issue updating dynamically the table rows, and V2 fixed it for me. Hopefully we see the official new release soon. Great work! |
glad you got it working with the V2 branch @jesucarr I am busy finishing the docs and demos for V2, which were lacking in the original release and I want to do it right this time around. Hopefully V2 will be available by the end of July |
I tried V2 with dynamically table rows by calling $('.footable').trigger('footable_initialized'), the added row did resize correctly but I faced 2 problems: a) Every time a single row is added dynamically, it will add another "+" expand image to the previous row. |
I have made a lot of changes to V2 branch and included a lot more demos and docs within the demos. I have also changed the event name to trigger. Rather call $('.footable').trigger('footable_initialize'); @liken85 the duplicate "+" bug is now fixed Check out the demo ajax.htm Please test it out and let me know if you find any issues. thanks |
@liken85 to hide a column completely, check out the hidden-columns.htm demo. All you need to do is add a few data attributes for the column: data-hide="all" - this makes sure the column is hidden at all breakpoints data-ignore="true" - this makes sure the column is left out the of detail row |
@bradvin, thank you. I have figured it out & that's the reason why I deleted the comment. |
@bradvin just updated to your latest V2 version and ajax updates on rows stopped working for me. Reverting back to the version you had 14 day ago fixes it |
I think some event names have changed - do you have an online demo I can test out? |
Sorry mate my code is in a private area :/ |
Tried the V2. It works :) and now I can also finally get rid of my custom css because the +/- are fonts now. However, there is small bug. I'll post it under separate issue. |
Awesome tables! // this is the code that runs after the AJAX call. All the data is received and // Now make sure the table is visible // finish with the JQuery trigger() with the 'footable_initialize event Bootstrap v3.0.0 Thanks again for an awesome plugin! |
I found a solution using the following as a success callback on my ajax call.
|
how footable parse the specified json? |
using a combination of
Always works for me, but the sorter breaks. Any idea how to sort of "restart" the footable sort plugin? |
Confirming that @RenegadeMaster 's solution worked for me, too. Luckily I didn't need the sorter. |
Hello,
First, Thank you for the plugin.
I would also like to apologize in advance if this is not a bug/issue but due to my lack of knowledge and should be posted elsewhere...
I'm trying to use footable with JQM, the data is retrieved via a REST service. The response is in json format and it seemed that every time i make an$.ajax or $ .getJSON call, the table is filled but it loses its responsiveness.
At first, i thought that it may have something to do with JQM but it doesn't seem to be the case.
For example. If i fork footable's gist and replace the following code in data-generator.js
Original code: This of course works 👍 .
Manually constructed Json code: This also works.
Result:
Google json: Table is filled but is no longer responsive
Result: Same thing happens with the jqm app accesing the internal rest service.
It looks to like the footable's attributes are not applied to the individual cells anymore.
I'm not sure if this is 'by design', a bug/issue with footable, jquery or 'most likely' me :).
Can somebody shed a light on what is happening here?
Thanks
The text was updated successfully, but these errors were encountered: