Beispiel #1
0
	$grid->MasterTable->AddColumn($column);

	$column = new GridBoundColumn();
	$column->HeaderText = "Phone";
	$column->DataField = "phone";
	//Add required field validator to make sure the input is not empty.
	$validator = new RequiredFieldValidator();
	$column->AddValidator($validator);
	$grid->MasterTable->AddColumn($column);

	$column = new GridBoundColumn();
	$column->HeaderText = "City";
	$column->DataField = "city";
	//Add required field validator to make sure the input is not empty.
	$validator = new RequiredFieldValidator();
	$column->AddValidator($validator);
	$grid->MasterTable->AddColumn($column);
	$column = new GridEditDeleteColumn();
	$grid->MasterTable->AddColumn($column);
	
	$grid->Process();
?>

<form id="form1" method="post">
	<?php echo $koolajax->Render();?>

	<div style='padding-bottom:5px;width:655px;'>	
		<i>*Note:</i> When editing or inserting row, you may test putting non-integer to CustomerNumber field or leave other input fields empty.
	</div>
	<?php echo $grid->Render();?>
</form>
Beispiel #2
0
 function setColumn()
 {
     $MT = $this->grid->MasterTable;
     $column = new GridBoundColumn();
     $column->DataField = "m_id";
     $column->ReadOnly = true;
     $column->Visible = false;
     $MT->AddColumn($column);
     $column = new GridBoundColumn();
     $column->DataField = "m_user";
     $column->HeaderText = "用户名";
     $column->NullDisplayText = "请添加该院系管理员";
     $column->AddValidator(REValidator::username());
     $MT->AddColumn($column);
     $column = new GridBoundColumn();
     $column->DataField = "m_name";
     $column->HeaderText = "姓名";
     $MT->AddColumn($column);
     $column = new GridDropDownColumn();
     $column->DataField = "dept_id";
     $column->HeaderText = "院系";
     $column->ReadOnly = false;
     $column->Visible = false;
     $deptobj = new department();
     $dept = $deptobj->getAll();
     foreach ($dept as $key => $value) {
         $column->AddItem($value, $key);
     }
     $MT->AddColumn($column);
     $column = new GridBoundColumn();
     $column->DataField = "dept_name";
     $column->HeaderText = "院系";
     $column->ReadOnly = true;
     $column->Width = "200px";
     $MT->AddColumn($column);
     $column = new GridBoundColumn();
     $column->DataField = "m_pwd";
     $column->HeaderText = "密码";
     $column->DefaultValue = "请使用强密码";
     $column->ReadOnly = false;
     $column->Visible = false;
     $column->AddValidator(REValidator::password());
     $MT->AddColumn($column);
     $column = new GridEditDeleteColumn();
     $column->ShowDeleteButton = true;
     $column->Align = "center";
     $MT->AddColumn($column);
 }