示例#1
0
	$grid->scriptFolder = $KoolControlsFolder."/KoolGrid";
	$grid->styleFolder="default";
	$grid->Width = "655px";
	$grid->RowAlternative = true;
	$grid->AjaxEnabled = true;
	$grid->AjaxLoadingImage =  $KoolControlsFolder."/KoolAjax/loading/5.gif";
	

	$table_order_detail = new GridTableView();
	$table_order_detail->Width = "100%";
	$table_order_detail->DataSource = $ds_order_detail;
	$table_order_detail->AddRelationField("orderNumber","orderNumber");
	$table_order_detail->AutoGenerateColumns = true;//Auto Generate all column from tables
	$table_order_detail->DisableAutoGenerateDataFields = "orderNumber";//Disable generate column for orderNumber data fields.

	$table_order = new GridTableView();
	$table_order->Width = "100%";	
	$table_order->DataSource = $ds_order;
	$table_order->AddRelationField("customerNumber","customerNumber");
	$table_order->AutoGenerateExpandColumn = true;
	$table_order->AutoGenerateColumns = true;
	$table_order->DisableAutoGenerateDataFields = "customerNumber";
	$table_order->AddDetailTable($table_order_detail);
	


	$grid->MasterTable->DataSource = $ds_customer;
	$grid->MasterTable->AutoGenerateExpandColumn = true;
	$grid->MasterTable->AutoGenerateColumns = true;
	$grid->MasterTable->AddDetailTable($table_order);
示例#2
0
	$grid->styleFolder="default";
	$grid->Width = "655px";
	$grid->RowAlternative = true;

	$grid->AjaxEnabled = true;

	$grid->MasterTable->AllowHovering = true;
	$grid->MasterTable->AllowSelecting = true;
		
	$grid->MasterTable->AutoGenerateColumns = true;
	$grid->MasterTable->AutoGenerateExpandColumn = true;
		
	$grid->MasterTable->DataSource = $ds_customer;		
	$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();	

	$order_table = new GridTableView();
	$order_table->DataSource = $ds_order;
	$order_table->AutoGenerateColumns = true;
	$order_table->Width = "100%";
	$order_table->Pager = new GridPrevNextPager();
	$order_table->AddRelationField("customerNumber","customerNumber");
	
	$grid->MasterTable->AddDetailTable($order_table,"Details order of {customerName}:");

	//Register Client-side event handler
	$grid->ClientSettings->ClientEvents["OnRowMouseOver"] = "Handle_OnRowMouseOver";
	$grid->ClientSettings->ClientEvents["OnRowSelect"] = "Handle_OnRowSelect";
	$grid->ClientSettings->ClientEvents["OnBeforeDetailTablesExpand"] = "Handle_OnBeforeDetailTablesExpand";
	$grid->ClientSettings->ClientEvents["OnDetailTablesExpand"] = "Handle_OnDetailTablesExpand";

	$grid->Process();