1. #31
    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


    Hi!

    This is probably just your cache ;-)
    The delete icon is only mentioned one time in Bancha.js.

    Please NEVER change a library file, that's bad. Use this instead:
    Code:
    Bancha.scaffold.Grid.destroyButtonConfig.items[0].icon = '/absolute-path/delete.png';
    Best regards
    Roland

  2. #32
    Sencha Premium Member
    Join Date
    Jan 2009
    Posts
    25
    Vote Rating
    0
    wirtsi is on a distinguished road

      0  

    Default Associated Data

    Associated Data


    Hi

    i know you guys only just started this, but this a feature that is probably needed sooner or later

    How can I display associated data in the grid or the form?

    Something like this

    Article -> belongsTo -> Collection
    Collection -> hasMany -> Article

    When viewing the Article grid, all I can see is the collection_id field and the collection's index ... but I would like to see Collection.name.

    The same unfortunately goes for HABTM ... this should be even a bit trickier

    All the best & thanks for your hard word

    wirtsi

  3. #33
    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


    Hi!

    Bancha is actually three things:
    - On the lowest layer it implements Ext.Direct in CakePHP
    - On top of this it provides cake models in extjs
    - and on top of this scaffold models (this part is missing for associations)

    So Bancha already provides all the possibilities to load the associated data (ext models are correctly associated). Only the scaffolding is missing yet.

    Well, we have more then just started, we already spend a few hundred hours on it. Of course, there is still much possibilities to extend

    So for your usage just add normal ExtJS column-code to the afterBuild interceptor:
    Code:
    Ext.create('Ext.grid.Panel', {
        scaffold: {
            afterBuild: function(config) {
                 config.columns.push({...});
                 return config;
            },
            ....
        }
    });
    For more see js api docs

    best regards
    Roland

  4. #34
    Sencha User
    Join Date
    Jan 2012
    Posts
    5
    Vote Rating
    0
    systematical is on a distinguished road

      0  

    Default Question on saving data with bancha

    Question on saving data with bancha


    So bancha seems to be working well. I have gone through the examples and the scaffolding works like a charm. Bancha has consumed my cakephp model in an extjs model nicely. I am trying to step out of simply using scaffoliding though by building my own data store into a grid with row editing. I am having problems saving the data using the extjs model bancha has created and was wondering if you could provide some pointers. As a disclaimer I only just started using extjs this monday so please be nice to a noob.

    I can get the following to work, but I know its not the right way. You can see from what was commented out what I was trying to do (thinking thats closer to the right way).

    Code:
        Bancha.onModelReady('Campaign', function() {
    
    
            Bancha.RemoteStubs.Campaign.index(function(result) {
    
    
                var myStore = Ext.create('Ext.data.JsonStore', {
                    model: Bancha.getModel('Campaign'),
                    data: result.data
                });
    
    
                var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
                    clicksToMoveEditor: 1,
                    autoCancel: false
                });
    
    
                Ext.create('Ext.grid.Panel', {
                    title:'Campaigns',
                    renderTo: 'LeftPanel-body',
                    store: myStore,
                    plugins: [rowEditing],
                    frame: true,
                    columns: [
                        {header: "Campaign", flex: 1, dataIndex: 'name', sortable: true, editor:{allowBlank: false}},
                        {text: "Created", flex: 1, dataIndex: 'created', sortable: true},
                        {
                            xtype:'actioncolumn',
                            width:20,
                            items: [{
                                icon: '/js/app/extjs/examples/shared/icons/fam/cog_edit.png',  // Use a URL in the icon config
                                tooltip: 'Edit',
                                handler: function(grid, rowIndex, colIndex) {
                                    loadPageGrid(grid.getStore().getAt(rowIndex));
                                }
                            }]
                        }
                    ]
                });
                rowEditing.on({
                    scope: this,
                    afteredit: function(roweditor, changes, record, rowIndex) {
                    
                        //var obj = Bancha.getModel('Campaign');
                        //obj.save();
    
    
                        var o = roweditor.record.data
                        Bancha.RemoteStubs.Campaign.update(o,function(result){
                            console.log(result);
                        });
                    }
                });
            });
        });
    Last edited by systematical; 2 Feb 2012 at 4:26 PM. Reason: added more code

  5. #35
    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


    Hi!

    You're doing things way to complicated.

    You ONLY use Bancha.RemoteStubs when you want to use exposed controller methods, for standard CRUD functions use the record directly.

    Code:
    Bancha.onModelReady('Campaign', function() {
    
        // create a normal store with a bancha model (everything is already configured in the model)
        var store = Ext.create('Ext.data.JsonStore', {
            model: Bancha.getModel('Campaign'),
        });
    
        // now load the data
        store.load();
    
        // --------------------------------------------------------
        // stuff below is just standard extjs code
        // --------------------------------------------------------
    
        var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
            clicksToMoveEditor: 1,
            autoCancel: false
        });
    
        Ext.create('Ext.grid.Panel', {
             ...
                                handler: function(grid, rowIndex, colIndex) {
                                    loadPageGrid(grid.getStore().getAt(rowIndex));
                                    // I can't see where you have defined this function
                                }
                            }]
                        }
                    ]
                });
                rowEditing.on({
                    scope: this,
                    afteredit: function(roweditor, changes, record, rowIndex) {
                    
                         // just save the record
                         record.save({
                             success: function() { console.info('saved to server'); }
                         });
    
                    }
                });
            });
        });
    best regards
    Roland

  6. #36
    Sencha User
    Join Date
    Jan 2012
    Posts
    5
    Vote Rating
    0
    systematical is on a distinguished road

      0  

    Default


    ^ Much easier, thanks.

  7. #37
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
    betolima is on a distinguished road

      0  

    Question download bancha projects

    download bancha projects


    Guys,anyone couldmake available for downloadbanchadone witha projectso that we can study better?
    Sowould be easierfor us to understandall thefile structuresand models.
    thank you

  8. #38
    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


    Hi!

    Currently the project which includes all sample code is online here: https://github.com/Bancha/BanchaTestProject

    That was the official part. I'm also working on a sample project for Integration with Sencha Designer, which you can find here: https://github.com/rolandschuetz/BanchaSampleProject
    Warning: This is currently not fully working and also includes many work-around and fixes for Sencha Designer.

    But actually you shouldn't need much more information than we already provide in the documentation:
    On the extjs side you just need two functions:
    - Bancha.onModelReady(modelNames,callback) to for async loading
    - Bancha.getModel(modelName) if the model is already loaded.

    On the server-side you just add the Bancha.BanchaRemotable behavior to cake models.

    I'm currently very bussy with my job, but when I find some free time I want to provide a screencast and I'm also working on a new release.

    If you have some specific questions I'm happy to help.

    cheers
    Roland

  9. #39
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
    betolima is on a distinguished road

      0  

    Thumbs up


    ok Dumas, thank you very much.

  10. #40
    Sencha User
    Join Date
    Dec 2010
    Posts
    56
    Vote Rating
    -1
    squalo is an unknown quantity at this point

      0  

    Question comprehension question

    comprehension question


    Hello
    does this combination: extjs - bancha - cakePHP - MySQL
    perhaps replace my approach using Ext.direct with those php query classes to access SQL data?

    In fact I got problems to realize a 'hasmany' relationship this way using Ext.model and Ext.direct api.
    Is this easier done including bancha and cakePHP?

    (Pls excuse, if this question is a bit greenly, but I'm encounting cakePHP the first time.)

    regards

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