Page 8 of 9 FirstFirst ... 6789 LastLast
Results 71 to 80 of 83

Thread: problem

  1. #71

    Default

    <img src="function renderNPreview(value) {
    return "
    <img src="" + value + "\">";
    return
    val;
    }
    " id="renderNPreview" style="width: 140px;"/>
    Ext.getCmp("renderNPreview").el.com.src = renderNPreview;
    where
    function renderNPreview(value){
    return
    '<img src="'+value+'">';
    return
    value;
    }

    Ext.getCmp("renderNPreview").el.com.src = "function renderNPreview(value){
    return
    '<img src="'+value+'">';
    return
    value;
    }
    ";
    figure it out by yourself...

  2. #72

    Default problem

    Thank for ur reply ..

    but still not working i follow ur guide..
    i get an error
    my js code
    PHP Code:
    Ext.onReady(function(){   
    //Ext.QuickTips.init();// turn on validation errors beside the field globally  
    Ext.form.Field.prototype.msgTarget 'side';    
    var 
    bd Ext.getBody();
    //   Define the Grid data and create the Grid  
    var myData = [ 
     [
    '3m Co',71.72,0.02,0.03,'9/1 12:00am','details.gif'],  
     [
    'Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am','box.gif']     
     ];   
    var 
    ds = new Ext.data.Store({     
     
    reader: new Ext.data.ArrayReader({},
      [              
      {
    name'company'},    
      {
    name'price'type'float'},  
      {
    name'change'type'float'},          
      {
    name'pctChange'type'float'},    
      {
    name'lastChange'type'date'dateFormat'n/j h:ia'}, 
      {
    name'renderNPreview'}  
     ])  
      }); 
     
    ds.loadData(myData);  
     
    // example of custom renderer function   
     
    function italic(value)
      {       
      return 
    '<i>' value '</i>'
      }   
     
    // example of custom renderer function   
     
    function change(val){  
      if(
    val 0)
       {         
       return 
    '<span style="color:green;">' val '</span>'
       }
       else if(
    val 0){ 
        return 
    '<span style="color:red;">' val '</span>';   
        }      
        return 
    val;   
        }    
    // example of custom renderer function 
        
    function pctChange(val){
         if(
    val 0){            return '<span style="color:green;">' val '%</span>';        }else if(val 0){            return '<span style="color:red;">' val '%</span>';        }        return val;    }
         function 
    renderNPreview(value){
          return  
    '<img  src="'+value+'">';
          return 
    value;
          }    
    // the DefaultColumnModel expects this blob to define columns. It can be extended to provide    // custom or reusable ColumnModels  
          
    var colModel = new Ext.grid.ColumnModel([      
           {
    id:'company',header"Company"width160sortabletruelocked:falsedataIndex'company'},     
           {
    header"Price"width75sortabletruerendererExt.util.Format.usMoneydataIndex'price'},  
           {
    header"Change"width75sortabletruerendererchangedataIndex'change'},     
           {
    header"% Change"width75sortabletruerendererpctChangedataIndex'pctChange'},    
           {
    header"Last Updated"width85sortabletruerendererExt.util.Format.dateRenderer('m/d/Y'), dataIndex'lastChange'}, 
           {
    header"renderNPreview"width75sortabletruerendererrenderNPreviewdataIndex'renderNPreview'}  
           ]);    
           
    bd.createChild({tag'h2'html'Using a Grid with a Form'});
           
    /* * Here is where we create the Form */   
            
    var gridForm = new Ext.FormPanel({   
            
    id'company-form',       
             
    frametrue,       
             
    labelAlign'left',   
             
    title'Company data',   
             
    bodyStyle:'padding:5px',   
             
    width750,     
             
    layout'column'
             
    // Specifies that the items will now be arranged in columns    
            
    items: [{ 
             
    columnWidth0.6,    
              
    layout'fit',  
              
    items: {         
              
    xtype'grid',   
               
    dsds,      
               
    cmcolModel,   
               
    sm: new Ext.grid.RowSelectionModel({     
               
    singleSelecttrue
                
    listeners: {     
                
    rowselect: function(smrowrec) {     
                 
    Ext.getCmp("company-form").getForm().loadRecord(rec);    
                 
    //  Ext.getCmp("renderNPreview").el.com.src = renderNPreview; 
                 
    Ext.getCmp("renderNPreview").dom.src ="function renderNPreview(value){return '<img src="'+value+'">';return value;}"
                 }            
                 }           
                 }),           
                  
    autoExpandColumn'company',  
                  
    height350,    
                  
    title:'Company Data',      
                  
    bordertrue
                  
    listeners: {  
                  
    render: function(g) {      
                   
    g.getSelectionModel().selectRow(0);         
                   },           
    delay10 // Allow rows to be rendered.    
                   
    }       
                   }       
                   },{     
       
    columnWidth0.4,       
        
    xtype'fieldset',    
        
    labelWidth90,       
        
    title:'Company details',        
        
    defaults: {width140}, // Default config options for child items          
       
    defaultType'textfield',        
        
    autoHeighttrue,        
        
    bodyStyleExt.isIE 'padding:0 0 5px 15px;' 'padding:10px 15px;',        
        
    borderfalse,          
        
    style: {           
        
    "margin-left""10px"
        },         
         
    items: [{     
         
    fieldLabel'Name',    
          
    name'company'         
          
    },
          {    
          
    fieldLabel'Price',   
           
    name'price'      
           
    },
           {    
           
    fieldLabel'% Change',  
            
    name'pctChange'   
            
    },{   
            
    xtype'datefield',  
             
    fieldLabel'Last Updated',    
             
    name'lastChange'       
             
    },    {     
             
    // xtype: 'datefield',   
             
    xtype'box',        
            
    id  'renderNPreview',  
          
    autoEl: { id:'renderNPreview'tag'img'src:''}      
             }       
             ]    
           }],        
              
    renderTobd 
              
    });      
             }); 
    help me ..............

  3. #73

    Default

    wakakakkakaka.... try to take refreshing... you're so messed up...

    THIS IS WRONG

    Ext.getCmp("renderNPreview").el.com.src = "function renderNPreview(value){
    return
    '<img src="'+value+'">';
    return
    value;
    }
    ";
    WHAT YOU WANNA GET IS..

    Ext.getCmp("renderNPreview").el.com.src = "YOUR_IMAGE.GIF";

  4. #74

    Default sorry

    its still not working

    i have an error

    Ext.getCmp("renderNPreview").el.com.src has no properties



    Ext.getCmp("renderNPreview").el.com.src = "topic.gif";


    Still not working help me....

  5. #75

    Default

    try reading examples and searching to google.com it will help

  6. #76

    Default

    try attached the whole files into a zip your html code and your js so that we can actually know what is the problem of your code so that we can test it and do changes ...

  7. #77
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    shahulhameed,

    You need to take some time to think about what's going on. Blindly copying code isn't going to get you anywhere.

    This forum isn't for teaching you how to be a developer, it's for help with ExtJS.

  8. #78

    Default

    just a quick guest...

    its .el.dom not el.com
    sory for the stupid typo.....


    please post your latest code.

  9. #79

    Default

    Thanks for ur reply

    my final js code.but still not working ...help me



    PHP Code:
     
     
    Ext
    .onReady(function(){   
    Ext.QuickTips.init();// turn on validation errors beside the field globally  
    Ext.form.Field.prototype.msgTarget 'side';    
    var 
    bd Ext.getBody();
    //   Define the Grid data and create the Grid  
    var myData = [ 
     [
    '3m Co',71.72,0.02,0.03,'9/1 12:00am','details.gif'],  
     [
    'Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am','box.gif']     
     ];   
    var 
    ds = new Ext.data.Store({     
     
    reader: new Ext.data.ArrayReader({},
      [              
      {
    name'company'},    
      {
    name'price'type'float'},  
      {
    name'change'type'float'},          
      {
    name'pctChange'type'float'},    
      {
    name'lastChange'type'date'dateFormat'n/j h:ia'}, 
      {
    name'renderNPreview'}  
     ])  
      }); 
     
    ds.loadData(myData);  
     
    // example of custom renderer function   
     
    function italic(value)
      {       
      return 
    '<i>' value '</i>'
      }   
     
    // example of custom renderer function   
     
    function change(val){  
      if(
    val 0)
       {         
       return 
    '<span style="color:green;">' val '</span>'
       }
       else if(
    val 0){ 
        return 
    '<span style="color:red;">' val '</span>';   
        }      
        return 
    val;   
        }    
    // example of custom renderer function 
        
    function pctChange(val){
         if(
    val 0){            return '<span style="color:green;">' val '%</span>';        }else if(val 0){            return '<span style="color:red;">' val '%</span>';        }        return val;    }
         function 
    renderNPreview(value){
          return  
    '<img  src="'+value+'">';
          return 
    value;
          }  
          
    //document.write(val);
          // the DefaultColumnModel expects this blob to define columns. It can be extended to provide    // custom or reusable ColumnModels  
          
    var colModel = new Ext.grid.ColumnModel([      
           {
    id:'company',header"Company"width160sortabletruelocked:falsedataIndex'company'},     
           {
    header"Price"width75sortabletruerendererExt.util.Format.usMoneydataIndex'price'},  
           {
    header"Change"width75sortabletruerendererchangedataIndex'change'},     
           {
    header"% Change"width75sortabletruerendererpctChangedataIndex'pctChange'},    
           {
    header"Last Updated"width85sortabletruerendererExt.util.Format.dateRenderer('m/d/Y'), dataIndex'lastChange'}, 
           {
    id:'renderNPreview',header"renderNPreview"width75sortabletruerendererrenderNPreviewdataIndex'renderNPreview'}  
           ]);    
           
    bd.createChild({tag'h2'html'Using a Grid with a Form'});
           
    /* * Here is where we create the Form */   
            
    var gridForm = new Ext.FormPanel({   
            
    id'company-form',       
             
    frametrue,       
             
    labelAlign'left',   
             
    title'Company data',   
             
    bodyStyle:'padding:5px',   
             
    width750,     
             
    layout'column'
             
    // Specifies that the items will now be arranged in columns    
            
    items: [{ 
             
    columnWidth0.6,    
              
    layout'fit',  
              
    items: {         
              
    xtype'grid',   
               
    dsds,      
               
    cmcolModel,   
               
    sm: new Ext.grid.RowSelectionModel({     
               
    singleSelecttrue
                
    listeners: {     
                
    rowselect: function(smrowrec) {     
                 
    Ext.getCmp("company-form").getForm().loadRecord(rec);    
                 
    //  Ext.getCmp("renderNPreview").el.com.src = renderNPreview; 
                          // szim = Ext.get("renderNPreview");
                 
    Ext.getCmp("renderNPreview").el.com.src  =renderNPreview;
                 }            
                 }           
                 }),           
                  
    autoExpandColumn'company',  
                  
    height350,    
                  
    title:'Company Data',      
                  
    bordertrue
                  
    listeners: {  
                  
    render: function(g) {      
                   
    g.getSelectionModel().selectRow(0);         
                   },           
    delay10 // Allow rows to be rendered.    
                   
    }       
                   }       
                   },{     
       
    columnWidth0.4,       
        
    xtype'fieldset',    
        
    labelWidth90,       
        
    title:'Company details',        
        
    defaults: {width140}, // Default config options for child items          
       
    defaultType'textfield',        
        
    autoHeighttrue,        
        
    bodyStyleExt.isIE 'padding:0 0 5px 15px;' 'padding:10px 15px;',        
        
    borderfalse,          
        
    style: {           
        
    "margin-left""10px"
        },         
         
    items: [{     
         
    fieldLabel'Name',    
          
    name'company'         
          
    },
          {    
          
    fieldLabel'Price',   
           
    name'price'      
           
    },
           {    
           
    fieldLabel'% Change',  
            
    name'pctChange'   
            
    },{   
            
    xtype'datefield',  
             
    fieldLabel'Last Updated',    
             
    name'lastChange'       
             
    },    {     
             
    // xtype: 'datefield',   
             
    xtype'box',        
            
    id  'renderNPreview',  
          
    autoEl: { id:'renderNPreview'tag'img'src:''}      
             }       
             ]    
           }],        
              
    renderTobd 
              
    });      
             }); 
    Error:Ext.getCmp("renderNPreview").el.com.src has no properties

  10. #80

    Default

    have you changed Ext.getCmp("renderNPreview").el.com.src

    to

    Ext.getCmp("renderNPreview").el.dom.src

    ????

    wtf...........
    Last edited by hendricd; 23 May 2008 at 5:54 AM. Reason: clarity

Page 8 of 9 FirstFirst ... 6789 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •