optikalefx / OpenJS-Grid

OpenJS Grid is the easiest jQuery Grid ever. With very little work you can have a data grid that can do everything from sorting and searching to complex database queries. Best of all, its open source. So you can learn how it's all done.
http://square-bracket.com/openjs
MIT License
96 stars 46 forks source link

How to reload the grid data after an event like adding #56

Closed shamsuljewel closed 9 years ago

shamsuljewel commented 9 years ago

In my application, i have a add form on the left and grid on the right side, I am using jquery for adding the rows into the mysql table, after showing the message, I want to not reload whole page, instead just reload the grid, I have used grid as like var $grid = $(".block-table").grid({ .....

and after the add event i am trying to reload the grid like $grid.grid("load"); and also tyied $(".block-table").grid(load); but didn't worked.

What is the proper way to reload the grid

optikalefx commented 9 years ago

$grid.grid("load"); is the right way to do this. See this video for an example https://www.youtube.com/watch?v=U5MGopAoQrM

If that's not working for you, check your $grid and make sure it's the right element.

shamsuljewel commented 9 years ago

Hi, thanks, I do not know what was happend, i already used $grid.grid("load"); and now its working. Probably it was cache or something like that. Anyway thanks for the help, and thanks for the grid, its pretty nice, i am using it in my new project. i like it. Only thing is that i don't like is Grid.php is still using mysql_connect, But its easier to make it works for PDO also, and its flexible

optikalefx commented 9 years ago

Thanks! I think someone one here made it PDO already. I can't seem to find the email though. If you wanted to convert the PHP file, please submit a PR for that.