RTolton
RTolton

Reputation: 53

Using jQuery Bootgrid Methods

How exactly are you meant to use the methods for jQuery BootGrid?

I've tried:

$("#presentation-listing-api").bootgrid('remove', [uid]);

Doesn't seem to be working?

It's not helpful that the documentation isn't quite finished yet.

Upvotes: 5

Views: 6905

Answers (3)

JimDeavers
JimDeavers

Reputation: 101

It should be noted, as of version [1.3.1], the "remove" feature is not supported when using the ajax option. There is a note in the source that reads

[ todo: implement ajax DELETE]

An alternative could be something like this:

$('[data-row-id="'+uid+'"]').remove();

Upvotes: 10

MB34
MB34

Reputation: 4424

The way to do it was kind of convoluted but I figured it out...

You have to mark your id column as an identifier and the type to numeric like this:

<th data-column-id="id" data-identifier="true" data-type="numeric">ID</th>

Then, MAKE SURE the values in that column are unique!!!

Then call the remove like this:

rows[0] = uid;
$("#presentation-listing-api").bootgrid('remove', rows);

What I did was took the Commands demo and modified it to load just some data then worked on getting the remove to work.

Here's a working fiddle:
http://jsfiddle.net/Mrbaseball34/zszc8zL6/

Upvotes: 5

Dimitry Castex
Dimitry Castex

Reputation: 21

Make sure you have the "id" variable as an integer in the associated object you are using to fill the table. With parseInt() worked even with ajax: false.

Upvotes: 1

Related Questions