Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Jan 2008
    Posts
    56
    Vote Rating
    0
    mpatel is on a distinguished road

      0  

    Question [SOLVED] Color Picker

    [SOLVED] Color Picker


    Hello guys,

    In the following code, I would like to have a color picker instead of the text box... how do i go about this?

    PHP Code:
    Ext.onReady(function(){

        
    Ext.BLANK_IMAGE_URL 'ext/resources/images/default/s.gif';
        
    Ext.QuickTips.init();

        
    Ext.form.Field.prototype.msgTarget 'side';
        
        var 
    parentList = new Ext.data.Store({    
            
    proxy: new Ext.data.HttpProxy({url'/categories/getCategories'}),
            
    reader: new Ext.data.JsonReader({
            
    root'categories',
            
    fields: [
                {
    name'id'},
                {
    name'name'}
            ]
            })
        });
        
        
    parentList.load();
        
        var 
    form_edit = new Ext.FormPanel({
            
    url:'/categories/edit/',
            
    frame:true,
            
    title'Edit Category',
            
    bodyStyle:'padding:5px 5px 0',
            
    width350,
            
    defaults: {width230},
            
    defaultType'textfield',

            
    items: [{
                    
    fieldLabel'Name',
                    
    name'data[Category][name]',
                    
    valueval_name,
                    
    allowBlank:false
                
    },{
                    
    fieldLabel'Color',
                    
    name'data[Category][color]',
                    
    valueval_color,
                    
    disabledtrue
                
    }, new Ext.form.ComboBox({
                    
    fieldLabel'Parent',
                    
    name'data[Category][parent_id]',
                    
    storeparentList,
                    
    displayField'name',
                    
    valueField'id',
                    
    mode'local',
                    
    forceSelectiontrue,
                    
    editablefalse,
                    
    mode'remote',
                    
    valueval_parent
                
    })
            ],

            
    buttons: [{
                
    text'Save'
            
    },{
                
    text'Cancel'
            
    }]
        });
        
        
    form_edit.render('content');
    }) 
    Thanks
    Last edited by mpatel; 17 Jan 2008 at 2:44 PM. Reason: Solved!

  2. #2
    Ext User para's Avatar
    Join Date
    Apr 2007
    Location
    Redmond, WA
    Posts
    918
    Vote Rating
    -2
    para has a little shameless behaviour in the past

      0  

    Default


    Try something like:
    Code:
                },{
                    fieldLabel: 'Color',
                    name: 'data[Category][color]',
                    value: val_color,
                    disabled: true,
                    xtype: 'colorpalette'
    I'm not sure though.

  3. #3
    Ext User
    Join Date
    Jan 2008
    Posts
    56
    Vote Rating
    0
    mpatel is on a distinguished road

      0  

    Question


    Excellent!!

    But how can I get more colors??
    I've changed the code a bit though:

    PHP Code:
    Ext.onReady(function(){

        
    Ext.BLANK_IMAGE_URL 'ext/resources/images/default/s.gif';
        
    Ext.QuickTips.init();

        
    Ext.form.Field.prototype.msgTarget 'side';
        
        var 
    parentList = new Ext.data.Store({    
            
    proxy: new Ext.data.HttpProxy({url'/categories/getCategories'}),
            
    reader: new Ext.data.JsonReader({
            
    root'categories',
            
    fields: [
                {
    name'id'},
                {
    name'name'}
            ]
            })
        });
        
        
    parentList.load();
        
        var 
    form_edit = new Ext.FormPanel({
            
    url:'/categories/edit/',
            
    frame:true,
            
    title'Edit Category',
            
    bodyStyle:'padding:5px 5px 0',
            
    width350,

            
    items: [{
                
    xtype:'fieldset',
                
    title'General Information',
                
    autoHeight:true,
                
    defaults: {width210},
                
    defaultType'textfield',
                
    items :[{
                    
    fieldLabel'Name',
                    
    name'data[Category][name]',
                    
    valueval_name,
                    
    allowBlank:false
                
    },new Ext.form.ComboBox({
                    
    fieldLabel'Parent',
                    
    name'data[Category][parent_id]',
                    
    storeparentList,
                    
    displayField'name',
                    
    valueField'id',
                    
    mode'local',
                    
    forceSelectiontrue,
                    
    editablefalse,
                    
    mode'remote',
                    
    valueval_parent
                
    })
                ]
            },{
                
    xtype:'fieldset',
                
    title'Category Color',
                
    collapsibletrue,
                
    autoHeight:true,
                
    defaults: {width210},
                
    defaultType'textfield',
                
    items :[{
                    
    fieldLabel'Color',
                    
    name'data[Category][color]',
                    
    valueval_color,
                    
    xtype'colorpalette'
                
    }
                ]
            }],

            
    buttons: [{
                
    text'Save'
            
    },{
                
    text'Cancel'
            
    }]
        });
        
        
    form_edit.render('content');
    }) 

    Quote Originally Posted by para View Post
    Try something like:
    Code:
                },{
                    fieldLabel: 'Color',
                    name: 'data[Category][color]',
                    value: val_color,
                    disabled: true,
                    xtype: 'colorpalette'
    I'm not sure though.

Thread Participants: 1