1. #71
    Sencha User
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
    alexleandrom is on a distinguished road

      0  

    Default How to create a find with params

    How to create a find with params


    Hi,

    I m using this Bancha, it s look very nice, but I want to know if there is some way to create a store which return to me a specific query in database, because When I use Store only pass the model I received all record of some entity, I need to make a simple conditions: Get all eventos from client_id = x, where I can make this?

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

      0  

    Default


    Hello guys,

    sry for the late response, I just was on holiday and I finally got a little bit of color

    Quote Originally Posted by vpetrunov View Post
    are there plans for Bancha to support relations between models?
    The models associations are already supported. Currently Bancha just does not yet add associated data in a model read request (in nested arrays). There are plans to support this soon.
    Associations can be quite tricky, so I might help you more if you can give me your use case.

    Quote Originally Posted by alexleandrom View Post
    I m using this Bancha, it s look very nice, but I want to know if there is some way to create a store which return to me a specific query in database, because When I use Store only pass the model I received all record of some entity, I need to make a simple conditions: Get all eventos from client_id = x, where I can make this?
    I'm currently working on this, so far I don't have a complete solution, bit it is quite good. If you use the filter-support branch and add the following line to your cakephp controller index method you can remotely filter:

    Code:
    class UsersController extends AppController {    public function index() {
            $this->User->recursive = 0;
            $this->Components->load('Paginator')->whitelist[] = 'conditions'; // allow Bancha to remotly filter
            $users = $this->paginate();
            $this->set('users', $users);
    
    
            // provide a return value for Bancha requests
            return array_merge($this->request['paging']['User'],
                array('records'=>$users));
        }
    ...
    }
    
    // and in extjs
    var store = Ext.create('Ext.data.Store', {
        model: Bancha.getModel('User'), // yes, that's all you have to do (proxy, fields. etc. is already configured)
    });
    
    // now filter and load
    store.filter('client_id',x);
    store.load();
    Best regards
    Roland

  3. #73
    Sencha User
    Join Date
    Apr 2009
    Posts
    10
    Vote Rating
    1
    kalchas is on a distinguished road

      0  

    Default


    Hello guys,
    i also had the same questions, so I followed this thread. I have made a store,
    based on a bancha model and declared remoteFilter: true.
    I tried your solution above, that is to embed the line


    $this->Components->load('Paginator')->whitelist[] = 'conditions'; // allow Bancha to remotly filter

    and filtered my store to a specific (property,value) pair.
    Cakephp continued to retrieve all the results, without implementing any filtering.
    So, with the help of firebug and cakephp documentation, I added the following lines to my controller.
    My model-database table is named Person.

    if (isset($this->params['pass'][0]['filter']))
    {
    $p=$this->params['pass'][0]['filter'][0];

    $field='Person.'.$p['property'];
    $val=$p['value'];
    $people = $this->paginate('Person', array("$field LIKE" => "$val%"));
    } else
    $people = $this->paginate();
    $this->set('people', $people);
    return array_merge($this->request['paging']['Person'],
    array('records'=>$people));


    I am looking forward to the next version of Bancha.
    Good work!!!

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

      0  

    Default


    Hello kalchas,

    Bancha's filter-support Branch support this, you shouldn't need the posted code. Are you sure you're on the filter-support Branch?
    Check out this example of how it currently works:
    http://filter-support-branch.banchap...ns-sample.html

    Best regards
    Roland

  5. #75
    Sencha User
    Join Date
    Apr 2009
    Posts
    10
    Vote Rating
    1
    kalchas is on a distinguished road

      0  

    Default Bancha filtering

    Bancha filtering


    Thank you Roland, it works with the new branch.


    Quote Originally Posted by Dumas View Post
    Hello kalchas,

    Bancha's filter-support Branch support this, you shouldn't need the posted code. Are you sure you're on the filter-support Branch?
    Check out this example of how it currently works:
    http://filter-support-branch.banchap...ns-sample.html

    Best regards
    Roland

  6. #76
    Sencha User
    Join Date
    Apr 2009
    Posts
    10
    Vote Rating
    1
    kalchas is on a distinguished road

      0  

    Default Nested Models

    Nested Models


    Dear Roland,
    are you going to support nested (associated) models in a future release?

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

      0  

    Default


    Yes, it is planed for the 1.4 release

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

      0  

    Default


    There've been a lot of new cool stuff in the last two weeks, check it out:

    - an article how to use Bancha with Sencha Architect 2
    - a Blog Reader App showcasing how to use Authentification and Sencha Architect 2
    - a new documentation
    - a new release, now supporting
    - loading of associated records and
    - remote filtering of stores

    I hope you like it, and you're looking forward to a lot more new features coming up soon!

  9. #79
    Sencha User
    Join Date
    Apr 2012
    Posts
    5
    Vote Rating
    0
    hemanthks2012 is on a distinguished road

      0  

    Default Store does not display BelongTo Association data but shows hasMany Associations data

    Store does not display BelongTo Association data but shows hasMany Associations data


    Hi.

    I have a CakePHP Model with many associations (hasMany and belongTo both). When I see store in firebug, it shows only hasmany associations not belongTo.

    Can u please help to resolve this issue with some example of belongTo Releationship.

    Regards,

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

      0  

    Default


    Hello,

    thanks for pointing this out, you're right. The default behavior of ExtJS belongsTo associations doesn't work so well. I have added a bit code to Bancha, now it works smoothly. Check out the updated samples and the code on github or the package download.

    Best regards,
    Roland

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