1. #41
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    565
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default


    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...

  2. #42
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    565
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default Bancha 1.0 Release Candidate

    Bancha 1.0 Release Candidate


    Bancha becomes dual-licensed and gets a lot of new features:I also added a introduction screencast.

    http://banchaproject.com

    Best regards
    Roland

  3. #43
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    pierzu is on a distinguished road

      0  

    Default


    How i can assiociate data with foreign keys now?

  4. #44
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    pierzu is on a distinguished road

      0  

    Default


    I also recommend to change 45 line in BanchaApi.php file for:

    Code:
    if(array_key_exists('Bancha.BanchaRemotable', $model->actsAs)) {
    Original line is not working in case, when you add something in your main appmodel, and additionaly something in each models.

  5. #45
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    565
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default


    Hello pierzu!

    Quote Originally Posted by pierzu View Post
    How i can assiociate data with foreign keys now?
    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.

    Quote Originally Posted by pierzu View Post
    I also recommend to change 45 line in BanchaApi.php file
    Thank you, you are right. It's updated.

    Best regards
    Roland

  6. #46
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    pierzu is on a distinguished road

      0  

    Default


    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?

  7. #47
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    565
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default


    Hello!

    Quote Originally Posted by pierzu View Post
    1. How i can show Group.name instead of User.group_id?
    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?


    Quote Originally Posted by pierzu View Post
    2. How i can change that Bancha will not get users'id field and how i can change main key for hid? (hidden id)
    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....

    Quote Originally Posted by pierzu View Post
    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?
    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
    Roland

  8. #48
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    pierzu is on a distinguished road

      0  

    Default


    Quote Originally Posted by Dumas View Post
    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?
    For example, as you said, 10 groups, 1000 users, what is the best solution?

    Quote Originally Posted by Dumas View Post
    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....
    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.

    Quote Originally Posted by Dumas View Post
    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?
    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.

  9. #49
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    565
    Vote Rating
    8
    Dumas is on a distinguished road

      0  

    Default


    Hello!

    The cool thing about Bancha is, it will do everything in the background for you. So your questions are actually standard ExtJS questions. ;-)


    Quote Originally Posted by pierzu View Post
    For example, as you said, 10 groups, 1000 users, what is the best solution?
    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:
    Code:
    renderer: function(group_id) {
        var rec = store.getAt(group_id);
        return rec ? rec.get('name') : '';
    }
    Quote Originally Posted by pierzu View Post
    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.
    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.



    Quote Originally Posted by pierzu View Post
    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.
    Bancha supports all filtering, so just filter your store before loading.
    Code:
    var filteredStore = Ext.create('Ext.data.Store',{
        model: Bancha.getModel('Article')
    });
    filteredStore.filter('published',false);
    filteredStore.load();
    best regards
    Roland

    PS: You opened an Issue which seems to be jus misconfiguration, please add further details for resolving the issue.

  10. #50
    Sencha User
    Join Date
    Sep 2009
    Posts
    27
    Vote Rating
    1
    Joel is on a distinguished road

      0  

    Default 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)
    Except this is a working Cake example so the model is definitely on the server and working. I had to change some other things as well, which is probably why I'm having issues.

    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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar