Skip to content
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

Get footable object #880

Open
merdj opened this issue Nov 27, 2020 · 2 comments
Open

Get footable object #880

merdj opened this issue Nov 27, 2020 · 2 comments

Comments

@merdj
Copy link

merdj commented Nov 27, 2020

Hello everyone,

I am making a project in which I want to use footable as my table for employees. The table have a very basic configuration. What I want now is to put an action column for delete. I want to put my own delete option rather than the built-in one.

I am following this code below unfortunately it is no longer working with the latest version 3x.
http://embed.plnkr.co/PYELgBc0xOpvH4lePXKu/

part of the code that i need below that I want it work.

        $(".footable").footable();

          //get the footable object
          var table = $(".footable");
          var footable = $(table).data("footable");

            var lastRow = $(table).find("tbody tr:last");
            footable.removeRow(lastRow);

When I try that code it says that footable is not defined.

can someone help me pls

thank you

@merdj
Copy link
Author

merdj commented Nov 28, 2020

Hello,

with much searching I was able to get the footable instance by following one example found here in the github. But i have another issue in which when I tried to delete a row. it says that 'deleteRow' is not a function.

can someone help me?

All I want is to customize my edit/delete option on my footable.

thanks for a help

@sherwinflight
Copy link

There is no "built in" delete option. It only provides the UI. You have to write or use your own custom Ajax function to actually do the deletion.

Since the plug-in only provides a UI it's better to use that for the front end stuff.

It's documented here: https://fooplugins.github.io/FooTable/docs/examples/component/editing.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants