Index
Examples
Download
Document
About us
Language:
Powered by PhpGrid | Template designed by Redline(Spinz )
Document
Sample
basic:One SQL staement
basic:Specify the table name and field name
basic:sql query
basic:Display Control
basic:Hide rows
basic:Form
basic:Access control
general:Form field type
general:Form the column control
general:Additional properties of the form fields
general:Validation
general:WYSIWYG editor,
general:Display more than one grid
general:Replacement of the skin
advanced:Customize the display data
advanced:Custom form fields
advanced:Overloaded form
Links
Code:
"Mark",2=>"Jockson",3=>"Tom",4=>"Sun"); /** * extend Datagrid ,rewrite the public of function * * @author cdwei * */ class myclass extends Datagrid{ //rewrite this function to custom table body function repalceValue( $row, $field, $value ) { if( $field=="cus_userid" ){ return $GLOBALS['user_list'][$value]; } if( $field=="cus_pic" ){ return '
'; } if( $field=="cus_name" ){ return '
'.$value.'
'; } return $value; } } $expamle = new myclass(); $expamle->tables = "`customer`"; //aim to-> SELECT `cus_id` ,`cus_name`,`cus_address`,`cus_phone` FROM `customer` $expamle->fields = array("cus_id","cus_name","cus_userid","cus_pic","cus_address","cus_phone"); $expamle->fieldDisplays = array("cus_name"=>"Customer's name","cus_userid"=>"User","cus_pic"=>"Pictrue","cus_address"=>"Address","cus_phone"=>"Phone"); $expamle->title = "List of customer"; $expamle->formTable = "`customer`"; $expamle->formFields = $expamle->fieldDisplays; $expamle->formTypes=array( 'cus_name' =>'text', 'cus_email' => 'text', 'cus_address' => 'text', 'cus_pic' =>'file', 'cus_phone' =>'text', 'cus_userid' => array('select',$GLOBALS['user_list']) ); $html = $expamle->display(); ?>
Customers
back
, Add form:
here
Click here to run