1. #81
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    0
    hemanthks2012 is on a distinguished road

      0  

    Default BelongTo Associations worked

    BelongTo Associations worked


    Hello Roland,

    Your solution worked well.

    Thanks for quick response.

    Best Regards

  2. #82
    Sencha User
    Join Date
    Oct 2012
    Posts
    18
    Vote Rating
    1
    qlc is on a distinguished road

      0  

    Default Other frameworks

    Other frameworks


    Any chance that you might be working on Bancha support for other PHP frameworks like Laravel?

  3. #83
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    581
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Hello,


    we are currently thinking about building Bancha for Symfony, so we would have the exact same JavaScript API and you could easily swap Symfony for CakePHP and vise versa.


    Developing Bancha took us more then 1500 hours, which is a lot of time/money for a small startup like ours. So we are currently evaluating if we want to take this path, and how many people actually would like to use it. Would you be interested in a Symfony port as well?


    Best regards
    Roland

  4. #84
    Sencha User
    Join Date
    Oct 2012
    Posts
    18
    Vote Rating
    1
    qlc is on a distinguished road

      0  

    Default Bancha

    Bancha


    Orginally we were going to use CakePHP for our latest project. But, Laravel is too compelling to not use. thanks for the reply.


    All the best,
    John.

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

      0  

    Default Bancha Component

    Bancha Component


    Hi roland,

    I started a project using cakephp,extjs and bancha. I baked all controllers using the bancha component. Then I made a grid with a row editor and I noticed that I couldn't save any record.

    I compared the controller augmentation on the site and what bake made for me. None of these where right, in order to make my record saved.

    So I modified the Bancha/Console/Templates/bancha/actions/controller_actions.ctp file, in particular the edit function like this:

    Line 122:
    from
    Code:
     if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
    to
    Code:
    if ($this-><?php echo $currentModelName; ?>->save($this->request->data['data']['0']['data'])) {
    I didn't check if a similar save action in the add function works.

    Now works fine, though I realized that the proxy is by default configured with batchActions:false,
    is that true?
    Is it possible for batchActions:true???

    Thanks

    PS. I am using the latest build of bancha from git.

  6. #86
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    581
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Hello!

    You should not need to augment the baking code, I know a lot of people which are using it without problems (still there might be a bug, so let's figure it out). Can you open the Browser console and send me the request content to bancha-dispatcher.php when you click on the save. Also please add the java script code. Thanks.

    Quote Originally Posted by kalchas View Post
    Now works fine, though I realized that the proxy is by default configured with batchActions:false,
    is that true?
    Is it possible for batchActions:true???
    I can see that the javascript comment wasn't very clear, so let me explain:

    There are two ways to batch requests:
    - Batch all requests of a particular action into one request, like {..., method:"save", data:[record1, record2,..]} (this is the store batchActions config)
    - Batch all requests on the application level, like [{..., method:"save", data:[record1]}, {..., method:"save", data:[record2]}]

    We are using the second approach which beside the advantage that there is actually more batching (different requests still gets batched together) it also best fits with cakes default behavior.

    For this reason please do not change this, it is already configured in the optimal way.

    Best regards
    Roland

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

      0  

    Default


    I am trying to make a grid, which includes columns from some related models.
    As I don't get my models related with one request, the Bancha.getModel() doesn't satisfy my needs. Instead, I preferred to make a model in ExtJs, configured my proxy api, with Bancha.RemoteStubs.<Model Name>.[create,read,update,destroy], configure some more fields with persist false, and define these as virtualfields (runtime) in my controller in the cakephp backend.

    I also modified the paginate function, making some left joins to the tables I need, so I could retrieve the data I want displayed.

    I preferred not to use the renderer function of grid column, because the related models may have large sets of data, and I don't want to waste my client's memory, in that way.

    Tell me, if I could use a better approach to my problem.

    Regards,

    Harry.

  8. #88
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    581
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Quote Originally Posted by kalchas View Post
    I am trying to make a grid, which includes columns from some related models.
    As I don't get my models related with one request, the Bancha.getModel() doesn't satisfy my needs. Instead, I preferred to make a model in ExtJs, configured my proxy api, with Bancha.RemoteStubs.<Model Name>.[create,read,update,destroy], configure some more fields with persist false, and define these as virtualfields (runtime) in my controller in the cakephp backend.
    When you use the CakePHP Model::virtualFields config Bancha does everything for you

    Quote Originally Posted by kalchas View Post
    I also modified the paginate function, making some left joins to the tables I need, so I could retrieve the data I want displayed.
    Can you send me your CakePHP find config, so we can find a way eigther Bancha can already do this or how to extend Bancha. Our goal is the Bancha handles (almost) every use case.


    Quote Originally Posted by kalchas View Post
    Tell me, if I could use a better approach to my problem.
    Please tell me a little more, either here in the forums or to support@banchaproject.org so I can help you find the optimal solution.

    Best Regards
    Roland

    PS: Does the scaffolding already work for you?

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

      0  

    Default Problem in getting associated data

    Problem in getting associated data


    Hi Roland,

    Back to basics, I want to render associated Data (only BelongsTo) so initial I used get[Model]() method of store in its datachanged event and override the values but it seems not working form me.

    Can you please answer following queries:

    1. Whether I should apply joins in CakePHP it self, If yes then give me an example to join 3 tables in [Which] functions of CakePHP (view or index)

    2. What changes i should make in ExtJS code.

    Regards,

    Hemant

  10. #90
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    581
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Hello Hemant!

    Quote Originally Posted by hemanthks2012 View Post
    1. Whether I should apply joins in CakePHP it self, If yes then give me an example to join 3 tables in [Which] functions of CakePHP (view or index)
    In most cases when you have a belongsTo you simply want to load the two stores individually and then do e.g. in the renderer for Article.user_id: return Ext.StoreMgr.get('Users').getById(user_id).get('name');

    You might want to use our scaffolding library, it does this for you. Check out the Article tab in the last example: http://scaffold.banchaproject.org/samples/

    Quote Originally Posted by hemanthks2012 View Post
    2. What changes i should make in ExtJS code.
    I'm not sure what exactly you want to do, if above doesn't help, please provide some more information (why do you want to join 3 things?, how are they connected, what do you actually want to display (a dataview, form, grid,....)).

    Best regards,
    Roland