The new year is coming. Time to plan Banchas next features!
What features would you like Bancha to get in the new year?
Happy new Year, or as we say here in Austria: Guten Rutsch!
Andreas, Florian, Kung and Roland
19 Mar 2013, 11:38 AM
A new version of Bancha is out, including i18n support and a lot more. Check it out:
Thank you, Dumas
Bancha is such a great plugin. I love it so much.
But I have a problem and need your support.
I write a function, which search records of a model. How can I return record as a model (like CURD) so that I can display them in a Ext.grid.Panel with pagination?
I find out a method store.filter() but it's not strong enough. I need to search on the server side and return result to the store.
Please give me a help.
Bancha supports this out of the box.
To perform the store.filter('field','value') on the server you only need to set the store's remoteFilter property to true.
An example can be found here:
Thank you Dumas,
With Roland Schutz's help, I tried to modify the index() function with request's params, and it works pretty well.
Originally Posted by Dumas
grid with hasOne data
Hi, is it possible with bancha to load a grid with associated data from a hasOne association? Let's say I have a Company with one Address and I want to show a grid with the names of the Company(s) and the fields from the Address model in one row.
How would I set that grid up in ExtJS 4 with Bancha? Ik have the associations setup in CakePHP and if I look in the console at bancha-dispatcher.php I can see all the associations when Bancha is loading the model Company. From the MySQL logs I can see that de query is done with the join on the table holding the addresses so this looks right on the CakePHP/Bancha side.
But when I load the model by Bancha.getModel('Company') it won't load the associated model Address. So what am I missing?
OK, I think I have found it. I baked the controller before I put this association in the model. The controller is just loading the data from the Companies tables without the associated Address model. I was thrown off by the bancha-dispatcher because the first time it's called it is just retrieving the metadata and that's when it is showing the right associations.
Strange that the MySQL logs show the right query though.
I will recreate the controller, see if that solves it and post back with the results.
you have touched a variaty of topics, so let me split them up:
- Loading of the MetaData as first request:
If you include the Bancha-API with /bancha-api/models/all.js the metadata is already included and this request will not be made.
- Association support:
Bancha understands associations, you don't need to re-bake the controller, Bancha takes the current model configuration and shares the associations with the frontend.
- Nested Loading:
CakePHP loads the address data for your company, but Bancha does not yet send this data directly. This is our next feature on our Roadmap and should be available before you put your app online ;-)
Currently Bancha will load the associated data (in your case the addresses) in a separate request if you need them, see this example: http://samples.banchaproject.org/ass...ns-sample.html
So you can use this in your development till the feature is ready.
Hope this clarifies things for you. Let me know if something is unclear.
Thanks for the quick reply. It's clear to me now and I'll wait for the next release. Lots of other stuff to work on. This is just one grid that I want loaded this way ;-)
Thanks for the great plugin!
23 May 2013, 1:04 AM
Hi, I'm trying to setup Bancha MVC style but it gives me an error 404 not found on the ExtJS files. I've downloaded the Sencha Architect BlogApp application and that gives me the same error. It looks like a conflict with the app folders of Bancha and CakePHP.
ExtJS is looking for the files in app/store/Articles.js but if I open that folder in my browser it can not find it and gives me a CakePHP error that controller AppController::Store() is not found. If I go to check with setup-check.html everything is fine.
ExtJS version is 4.1.1a GPL, version of CakePHP is 2.3.5 and Bancha is the latest release.
Edit: Can confirm that this is the same with ExtJS 4.07 and CakePHP 2.2.4