I have few questions on Gridview , Could some one please throw some light on them ?
In my model I have two fields Firstname and lastname , I want to show them together in one column field (some thing similar to ‘firstname lastname’) and also a filter field on this combined view field
If the above case is not possible to implement , Can I write a DAO layer to provider my own implementation to this view ? But I see the data provider it is taking is CMODEL… Any ideas how to implement this and customize in our own way ?
Filter field , I have to enter the text and press enter for it filter the data . Is there any way I can add event that triggers for keydown and filters … I mean automatically filtering for every character ( May be starting filter after entering 3 or 4 characters )
As for the 3rd question, I’ve tried a little but got no successful result.
But when you use an independent search form outside of the grid, e.g. the folded "advanced" search form in the gii-generated admin page, you might want to try the following:
#Customer_customername stands for the input field in the search form.
This will fire an ajax search as you type the search words with a delay of 1000 ms.
It’s very comfortable.
I’m quite satisfied with this trick and am using it in my pages with CGridView, where I have modified the folded “advanced” search form to be displayed all the time.
Nice trick softark . Before using Yii I wrote my own code for this and It is working pretty fast and good . But since lack of CSS skills , I couldn’t make it looking good I can share with you what I have . If it is fine for you I can upload it to rapidshare or somewhere and share you the code I have . It basically uses jquery.jqGrid.min.js .
Thank you. But I have no experience with jquery.jqGrid. And could it be used with CGridView? I’m afraid not … So I think I will not be able to make use of your interesting code. I’m quite satisfied with Yii and CGridView, and have no mind right now to go the other way.
I’d rather request you to look into jquery.yiigridview.js to solve your 3rd question and show me how to do it.