ComboGrid

Extend from $.fn.combo.defaults and $.fn.datagrid.defaults. Override defaults with $.fn.combogrid.defaults.

Dependencies

Usage

  1. <select id="cc" name="dept" style="width:250px;"></select>  
  1. <input id="cc" name="dept" value="01">  
  1. $('#cc').combogrid({  
  2.     panelWidth:450,  
  3.     value:'006',  
  4.    
  5.     idField:'code',  
  6.     textField:'name',  
  7.     url:'datagrid_data.json',  
  8.     columns:[[  
  9.         {field:'code',title:'Code',width:60},  
  10.         {field:'name',title:'Name',width:100},  
  11.         {field:'addr',title:'Address',width:120},  
  12.         {field:'col4',title:'Col41',width:100}  
  13.     ]]  
  14. });  

Properties

The properties extend from combo and datagrid, below is the added properties for combogrid.

Name Type Description Default
loadMsg string The message displayed when datagrid load remote data. null
idField string The id field name. null
textField string The text field to be displayed in textbox. null
mode string Defines how to load datagrid data when text changed. Set to 'remote' if the combogrid loads from server. local
filter function(q, row) Defines how to select the local data when 'mode' setted to 'local'. Return true to select the row.

Events

The events extend from combo and datagrid.

Methods

The methods extend from combo, below is the added or overriden methods for combogrid.

Name Parameter Description
options none Return the options object.
grid none Return the datagrid object.
setValues values Set the component value array.
setValue value Set the component value.
clear none Clear the component value.