-
20 Mar 2012 11:47 AM #41
Hallo!
HasMany is currently working very limited in ExtJS currently, so Bancha can also only support basic operations.
Bancha and CakePHP will provide you with a lot of out of the box solutions. CakePHP is a PHP-Framework (like Symfony) which makes it very easy to do all kinds of standard functions, like validating data, saving data, etc.
Checkout some of the CakePHP tutorials to get an idea of what it is doing. If you are new to PHP, I can tell you in the long run you definitely want to use a Framework. Most famous are Symfony, Zend Framework, and then CakePHP ;-)
In the next two or three days there will be a major release, but I can't say too much yet...Roland Schütz
Senior Software Architect
---
Bancha Project - Seamless integrate CakePHP with ExtJS and Sencha Touch
-
26 Mar 2012 9:55 PM #42
Bancha 1.0 Release Candidate
Bancha 1.0 Release Candidate
Bancha becomes dual-licensed and gets a lot of new features:
- Sencha Touch Support
- File Uploads
- Expose any controller method
- Lots of refactoring and bug fixes
- API-Viewer for JS Developers
http://banchaproject.com
Best regards
RolandRoland Schütz
Senior Software Architect
---
Bancha Project - Seamless integrate CakePHP with ExtJS and Sencha Touch
-
29 Mar 2012 5:18 AM #43
How i can assiociate data with foreign keys now?
-
29 Mar 2012 5:27 AM #44
I also recommend to change 45 line in BanchaApi.php file for:
Original line is not working in case, when you add something in your main appmodel, and additionaly something in each models.Code:if(array_key_exists('Bancha.BanchaRemotable', $model->actsAs)) {
-
30 Mar 2012 10:29 AM #45
Hello pierzu!
I don't understand your question exactly. If you define CakePHP associations in your CakePHP model Bancha will automatically map these to Bancha.
This currently works only with default foreign keys, but will be working with everything in the final 1.0 release.
Thank you, you are right. It's updated.
Best regards
RolandRoland Schütz
Senior Software Architect
---
Bancha Project - Seamless integrate CakePHP with ExtJS and Sencha Touch
-
2 Apr 2012 4:39 AM #46
For example, i have two tables, "users" and "groups".
Users table fields : id, hid, name, group_id
Groups fields : id, hid, name
Ofc exisiting foreign key, model association.
I'm creating grid, connected to model User, so i have columns: id, hid, name, group_id.
1. How i can show Group.name instead of User.group_id?
2. How i can change that Bancha will not get users'id field and how i can change main key for hid? (hidden id)
My next problem, same tables, i have edit form for groups, where i see all group fields and grid, where are users, wchich belong to this group.
Grid is connected to model Group, and Bancha download all users. How i can send param like group_id, to show users, who are in this group?
-
2 Apr 2012 1:35 PM #47
Hello!
ExtJS is currently not supporting an convenient way for this, the ExtJS data model is missing any good solution.
So solutions are use case specific, about how much data are we talking about here? About row much rows for group and for user are you expecting? 10 groups, 1000 users?
Every record should always keep there id field in the model! Just don't display this field in the grid.
Why are you having id and hid? CakePHP expects the main key to always be named 'id'. Cake will not like this....
I'm not sure if I understood you correctly. I think your question was "How can I filter the loaded user-entries by group_id=XY?"
Do you want to create a new store each time or just load new data in an existing store?
best regards
RolandRoland Schütz
Senior Software Architect
---
Bancha Project - Seamless integrate CakePHP with ExtJS and Sencha Touch
-
3 Apr 2012 1:58 AM #48
For example, as you said, 10 groups, 1000 users, what is the best solution?
Ok, i know how to don't display id, but, if user will look at source, there will be all data. I want to avoid thtat, user will know record id's. I have id as primary int key, hid as id, wchich i want to display outside, in requests for example.
Yes, i want to display only records, where group_id is equal to something. It could be filtering data after load, but better solution could be download data, wchich match my condition.
I want to create store for each group.
I have grid, where are groups, i click edit and i see two tabs form, first tab - form with group data, second tab - grid with group users.
-
3 Apr 2012 4:47 AM #49
Hello!
The cool thing about Bancha is, it will do everything in the background for you. So your questions are actually standard ExtJS questions. ;-)
So if your associated grid (groups) is quite small there is no drawback in loading the whole store and then define a custom render in the grid. So define the custom renderer for User.group_id like this:
I was about to write you some code for your solution... but it really looks wrong. Normally there is no security risk at all displaying the real id's and your solution with id & hid will create a lot of un-cakish code which you will soon wonder what you did... you might wanna chat with some guys on #cakephp.Code:renderer: function(group_id) { var rec = store.getAt(group_id); return rec ? rec.get('name') : ''; }
Bancha supports all filtering, so just filter your store before loading.
best regardsCode:var filteredStore = Ext.create('Ext.data.Store',{ model: Bancha.getModel('Article') }); filteredStore.filter('published',false); filteredStore.load();
Roland
PS: You opened an Issue which seems to be jus misconfiguration, please add further details for resolving the issue.Roland Schütz
Senior Software Architect
---
Bancha Project - Seamless integrate CakePHP with ExtJS and Sencha Touch
-
4 Apr 2012 3:29 AM #50
Can't get it to work
Can't get it to work
Okay, I must be missing something in this. Does this actually work with an Ext.Application style app? I've had a number of problems and I still can't get it to work. The error I'm getting is:
- Uncaught Ext.Error: Bancha: Couldn't create the model cause the model is not supported by the server (no remote model)
1) I had to change the order of the scripts so that I load the bancha-api.js file first. Otherwise it complains that the Bancha namespace is missing. From looking at the code this makes sense in this order. How is it working for everyone else
2) I'm using Ext.Loader to load my files, but then Ext complains because the Bancha stuff is all in one file. I've been using ExtJs3 for the last couple of years, so I'm new to the ExtJs4 ways of doing things. I had to override Ext.Loader to ignore Bancha scripts.
I'm obvisouly missing something very fundamental. Is there an example implementation that actually uses the proper MVC architecture. The examples provided are just simple scripts loading a grid and aren't really meaty enough to get behind


Reply With Quote