EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pandukhabaya on March 09, 2013, 12:54:50 AM



Title: Number formatting Drop down auto fill not working
Post by: pandukhabaya on March 09, 2013, 12:54:50 AM

$('#tt').datagrid({
        title:'Temporary Excesses', 
        iconCls:'icon-edit', 
        width:'fit-content', 
        height:'500', 
        singleSelect:true,
        idField:'id', 
        url:'<?php echo base_url(); ?>index.php/tempexcess/excessData/',
       
        toolbar:[{
                    text:'Add New',
                    iconCls:'icon-add',
                   
                handler:function(){
                    if($('#user_role').val()=='checker'){
                            alert('You don\'t have permission to do this operation !');
                        }
                        else if($('#user_role').val()=='maker'){
                        insert();
                }
                }

                }
            ],
       
        columns:[[
         {field:'company_name',title:'Company Name',sortable:'true',
                 formatter:function(value){ 
                       for(var i=0; i<company_namelist.length; i++){
                          if (company_namelist.company_name == value) return company_namelist.name;
                       }
                       return value; 
                   }, 
                   editor:{ 
                       type:'combobox',
                           options:{
                           valueField:'company_name',
                           textField:'name',
                           data:company_namelist,
                           required:true,
                               onSelect:function(record){
                                  
                           var row = $('#tt').datagrid('getSelected');
                           var rowIndex= $('#tt').datagrid('getRowIndex', row)
            var editors = $('#tt').datagrid('getEditors', rowIndex);
                          
                           var leidEditor = editors[0];
                           $(leidEditor.target).combobox('setValue',record.company_name);
                                    
                               }
                           }
                   }
              
            },
            {field:'amount',title:'Amount',groupSeparator:' ',options:"precision:2,groupSeparator:' ',decimalSeparator:'.'" ,sortable:'true',width:100,editor :
                      { type:'numberbox',
                               options:{
                               // precision:2 //,
                                groupSeparator:','
                              
                               }
                               }
                      
            }, 
        onBeforeEdit:function(index,row){ 
            row.editing = true; 
            updateActions(index,row); 
        }, 
        onAfterEdit:function(index,row){ 
            row.editing = false; 
            updateActions(index,row); 
        }, 
        onCancelEdit:function(index,row){ 
            row.editing = false; 
            updateActions(index,row); 
        }   
           
        });
         


1.in my grid number formatting is not working
2.when typing words it is not allow to autofil combobox [typing is not allowed inside combobox]