[EXTENSION] jquery Flexigrid

Hi, I created a extension for the jquery flexigrid for http://www.flexigrid.info/.

I created a “demo” with this extension for the blog from the yii demos see blog.rar attachment.

If you extract it to your blog you should be able to access it via

'/demos/blog/index.php/postgrid/admin'

The Flexigrid is fully useable and working.

It also saves various settings in Session variables e.g. sort, order, query, order of columns, width of colums etc.

So if you visit the page again you will get the last view in the same session.

I am currently at a point where I wanted the code to be more 'generic'.

Sadly i don't know that much from yii at the moment (i am still learning). So I don't know how several things could be coded in a better way then currently.

Points which i doesn't like:

  • too much code to be added to the controller (some functions to be added)

  • js code for action buttons of the flexigrid which call ajax functions only to generate a link to forward to the update page.

  • unclean code of the widget ( i just modified from the CTreeView widget so there are still code and comments from this widget)

What i would like to get the extension more compact and be able to run without too much code to be added to the controller.

e.g. Could the Session saving be done in the extension itself?

I Don't know what is possible with actions / behaviors etc.

The flexigrid requires jquery 1.3.1 because jquery 1.3 (comes with the lates yii) has a bug with selectors [otherwise the column resizing doesn't work]

Also the flexigrid.js code is modified on several parts:

  • page / order / sort pre selecting

  • search options settings

  • on resize events and function to store the columns size and order

Some code is not directly from me. I used and looked some demos from CodeIgniter and used some parts from other forums and mailing lists (e.g. how to get the resized columns in js code)

Please post any comments.

Nice work!

But I have error like this when I want to create or edit a post.

Quote

Fatal error: Call to undefined method Post::getCategory() in C:\AppServ\www\yii\demos\blog\protected\views\postgrid\_form.php on line 47

Upps just remove the getCategory Part and getMultipleCategory parts cause this was from a test where I tried the dropdown and activecheckboxLists. Cause you don't have those tables and modifications in the Postmodel you get this error on the form.

This was only in the _form.php attached 'cleaned' version. Also fixed in the rar in the first post.

i suggest you to post your extension in the extensions section of the site. Otherwise it is hard to mantain it.

Could you upload the example again? thanks

Thanks for sharing horizons… could you please uploaded to the Extensions sections of the site? Such good extension deserves a place there…

plase upload again .

I want to use this extension in my application. But download link is not working. Can you please upload the file again and sent me a link for same?

Link is down. Can you repost your link?

[#10173] We could not find the attachment you were attempting to view.

The new place of the extension download is here

Please let us know if it still works on the actual yii version.