Hybrid View

  1. #1
    Sencha User attu's Avatar
    Join Date
    Aug 2008
    Location
    Madrid, Spain
    Posts
    95
    Vote Rating
    0
    attu is on a distinguished road

      0  

    Default Grids, checkbox and combo

    Grids, checkbox and combo


    Hello!

    I've got some problems with my app.

    1. I've got a combo as a field of one of my grids:
    It works as i want, but when i select one of the results and i blur my combo, it shows the id...

    There is the code:
    Code:
    {
                header: "Empleado",
                width: 200,
                sortable: true, 
                dataIndex: 'Empleado',
                editor: new Ext.grid.GridEditor(new Ext.form.ComboBox({
                    store: new Ext.data.JsonStore({
                        url: '../contratos/gestionEmpleados.php',
                        root: 'filas',
                        baseParams: parametros,    
                        fields: ['id', 'nombre'],
                        totalProperty: "results"
                    }),
                    displayField:'nombre',
                    typeAhead: true,
                    valueField: 'id',
                    mode: 'remote',
                    hideTrigger: true,
                    minChars: 1,
                    maxChars: 9,
                    forceSelection: true,
                    triggerAction: 'all',
                    selectOnFocus:true
                })
                )        
            }

    2. I've got 2 grids from the same controller (an own controller). If i comment one of them, the other one works fine, but when i use both, it just works the second one. When i select an item from the first grid, it selects the second one.

    Do you know why is it? i tried to render my grids in different panels but it didn't work...

    Thanks a lot!

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    1. you need to use a renderer. I think there was a feature request to make that a little easier, it was posted in last 3 months or so. It was just a request, I don't recall if sample code was posted. Short answer is use a renderer. You may also want to check the hiddenName config if you plan to submit to backend.
    2. smells like you've re-used an id or store. You didn't post any code, so who knows?

  3. #3
    Sencha User attu's Avatar
    Join Date
    Aug 2008
    Location
    Madrid, Spain
    Posts
    95
    Vote Rating
    0
    attu is on a distinguished road

      0  

    Default


    Thanks for your fast response!!!

    Ok! I'll try to use renderer...

    Those are my grids:
    Code:
    gridObservaciones = new grid_1xN({
            tabla: 'obsoferta',
            id_PK1: 'Oferta',
            id_PKN: 'IDobsoferta',
            valorId_PK1: idOferta,
           
            columnasRelacion: [{
                header: "Fecha", 
                width: 120,
                sortable: true, 
                dataIndex: 'Fecha',
                editor: new Ext.form.DateField({
                    allowBlank: false,
                    allowNegative: false,
                    allowDecimals:false
                })
            },{
                header: "Empleado",
                width: 200,
                sortable: true, 
                dataIndex: 'Empleado',
                editor: new Ext.grid.GridEditor(new Ext.form.ComboBox({
                    store: new Ext.data.JsonStore({
                        url: '../contratos/gestionEmpleados.php',
                        root: 'filas',
                        baseParams: parametros,    
                        fields: ['id', 'nombre'],
                        totalProperty: "results"
                    }),
                    displayField:'nombre',
                    typeAhead: true,
                    valueField: 'id',
                    mode: 'remote',
                    hideTrigger: true,
                    minChars: 1,
                    maxChars: 9,
                    forceSelection: true,
                    triggerAction: 'all',
                    selectOnFocus:true
                })
                )        
            },{
                header: "Comentario",
                width: 350,
                sortable: true, 
                dataIndex: 'comentario',
                editor: new Ext.form.TextField({
                    allowBlank: false
                })
            }]
        });
        
            //Grid de Subsanaciones
            gridSubsanaciones = new grid_1xN({
                tabla: 'subsanaciones',
                id_PK1: 'idOferta',
                id_PKN: 'idSubsanacion',
                valorId_PK1: idOferta,
        
                columnasRelacion: [{
                    header: "fecha notificacion",
                    width: 100,
                    sortable: true, 
                    dataIndex: 'fechaNotificacion',
                    editor: new Ext.form.DateField({
                        allowBlank: false
                    })
                },{
                    header: "Deficiencias", 
                    width: 400,
                    sortable: true, 
                    dataIndex: 'deficiencias',
                    editor: new Ext.form.TextField({
                        allowBlank: false                    
                    })
                },{
                    header: "Fecha otorgada",
                    width: 100,
                    sortable: true, 
                    dataIndex: 'fechaOtorgada',
                    editor: new Ext.form.DateField({
                        allowBlank: false
                    })
                },{
                    header: "¿Subsanado?",
                    width: 80,
                    sortable: true, 
                    dataIndex: 'subsanado',
                    editor: new Ext.form.Checkbox()
                }]
            });
    I forgot checkbox topic! Basicly, the problem is it isn't shown the checkboxes, it shows just when i select the item...


    Thanks!

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Am I supposed to know what grid_1xN is?

  5. #5
    Sencha User attu's Avatar
    Join Date
    Aug 2008
    Location
    Madrid, Spain
    Posts
    95
    Vote Rating
    0
    attu is on a distinguished road

      0  

    Default


    grid_1xN is coded by my own. It's a generic generator of grids with 1xN relation...

    I think the problem is with my controller, because i reference it with "this". I think second grid is always "this" and i can't reference to the first one becouse of it... could it be that?

    Thanks!

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    I don't know what your grid class is, I don't know what your controller is.

    http://extjs.com/learn/Ext_Forum_Help

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi