1. #1
    Sencha User
    Join Date
    Jun 2008
    Posts
    227
    Vote Rating
    1
    sseema is on a distinguished road

      0  

    Default Editor field problem in grid

    Editor field problem in grid


    Hi,

    I created one grid that is editorgrid panel.
    In that I put one field as editable.When I edit that field the whole record renders values.
    I dont want to renders entire record .I want to change only that edit field.

    I dont know how to do it and where to do it in ext-all-debug.js file.

    If any body knows about it please help me.

    I appreciate any help.

    Thank You.

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

      0  

    Default


    Post code. You shouldn't be doing anything in ext-all-debug.

  3. #3
    Sencha User
    Join Date
    Jun 2008
    Posts
    227
    Vote Rating
    1
    sseema is on a distinguished road

      0  

    Default


    Thanks for your reply..

    Actually I am having two type of records that is with grouping header and without grouping header.

    I mean if grouping records are more than one it has header and if it has only one record it doesn't has header.I just differentiate with colors those records.I put blue color for records
    those are not having header.

    In this grid one field as editor field.When I click on that edit cell and when I click on out of cell the color changes to default color.I dont want to change that color.

    My code .....

    gridRowRender : function(cs, rs, ds, startRow, colCount, stripe){
    var ts = this.templates, ct = ts.cell, rt = ts.row, last = colCount-1;
    var tstyle = 'width:'+this.getTotalWidth()+';';
    // buffers
    var buf = [], cb, c, p = {}, rp = {tstyle: tstyle}, r;
    var start = 0;
    //console.log("rs length "+rs.length);
    if(rs.length>1)

    start = 0;
    if(rs.length==1){
    //Ext.fly(this.innerHd).on("click", this.handleHdDown, this);
    for(var j = start, len = rs.length; j < len; j++){
    r = rs[j]; cb = [];
    var rowIndex = (j+startRow);

    for(var i = 0; i < colCount; i++){
    c = cs[i];
    p.id = c.id;
    p.css = i == 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
    p.attr = p.cellAttr = "";

    if(start == 1 && i!=0 && i!= last) {
    p.value = '';
    } else {
    p.value ='<font color="#3764A0">'+ c.renderer(r.data[c.name], p, r, rowIndex, i, ds)+'</font>';
    }
    p.style = c.style;
    if(p.value == undefined || p.value === "") p.value = " ";
    if(r.dirty && typeof r.modified[c.name] !== 'undefined'){
    p.css += ' x-grid3-dirty-cell';
    }
    cb[cb.length] = ct.apply(p);
    }

    var alt = [];
    if(stripe && ((rowIndex+1) % 2 == 0)){
    alt[0] = "x-grid3-row-alt";
    }
    if(r.dirty){
    alt[1] = " x-grid3-dirty-row";
    }
    rp.cols = colCount;
    if(this.getRowClass){
    alt[2] = this.getRowClass(r, rowIndex, rp, ds);
    }
    rp.alt = alt.join(" ");
    rp.cells = cb.join("");
    buf[buf.length] = rt.apply(rp);
    }}
    else
    {
    //Ext.fly(this.innerHd).on("click", this.handleHdDown, this);
    for(var j = start, len = rs.length; j < len; j++){
    r = rs[j]; cb = [];
    var rowIndex = (j+startRow);

    for(var i = 0; i < colCount; i++){
    c = cs[i];
    p.id = c.id;
    p.css = i == 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
    p.attr = p.cellAttr = "";

    if(start == 1 && i!=0 && i!= last) {
    p.value = '';
    } else {
    p.value =c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
    }
    p.style = c.style;
    if(p.value == undefined || p.value === "") p.value = " ";
    if(r.dirty && typeof r.modified[c.name] !== 'undefined'){
    p.css += ' x-grid3-dirty-cell';
    }
    cb[cb.length] = ct.apply(p);
    }

    var alt = [];
    if(stripe && ((rowIndex+1) % 2 == 0)){
    alt[0] = "x-grid3-row-alt";
    }
    if(r.dirty){
    alt[1] = " x-grid3-dirty-row";
    }
    rp.cols = colCount;
    if(this.getRowClass){
    alt[2] = this.getRowClass(r, rowIndex, rp, ds);
    }
    rp.alt = alt.join(" ");
    rp.cells = cb.join("");
    buf[buf.length] = rt.apply(rp);
    }
    }
    return buf.join("");
    },




    my colmod .....

    colmod=new Ext.grid.ColumnModel([
    {id:'itemno',align:'center',header:"Item No",width:80, sortable: true, dataIndex: 'gs_itemno'},

    {id:'cname',align:'center',header:"CName",width:130, sortable: true, dataIndex: 'cname'},

    {id:'size',align:'center',header:"Size", sortable: true,width:50, dataIndex: 'gs_size'},
    {id:'price',align:'center',header:"Price", sortable: true,width:50, dataIndex: 'gs_price'},
    {id:'aaa',align:'center',header:"Qty",width:50,sortable: true, dataIndex: 'aaa',align:'center',editor:new Ext.form.NumberField({id:'sty',name:'e_qty',allowNegative:false,maxValue:100000}),renderer:function(value,params,record){
    return value?value:1;}},
    {id:'gid',header:"Size",hidden:true,hideable:false, sortable: true,width:100, dataIndex: 'gsid'},
    {id:'gid2',header:"name", hidden:true,hideable:false,sortable: true,width:100, dataIndex: 'g1d'}

    ]);

    Please help me.

    Thank You.

  4. #4

Thread Participants: 1