Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use cCustomerDataDictionary.DD Use csfWebList.pkg Use csfWebColumn.pkg Use csfWebColumnButton.pkg Use cJsonObject.pkg Use cWebButton.pkg Use CustomerEdit.wo Object oSyncFusionGridCustomerList is a cWebView Set psCaption to "SyncFusion Grid Customer table (db enabled)" // Your DDO structure will go here Object oCustomer_DD Is a cCustomerDataDictionary End_Object Set Main_DD to oCustomer_DD Set Server to oCustomer_DD Object oWebMainPanel is a cWebPanel Set piColumnCount to 12 // place controls here. // Your view will grow as controls are added Object oForm is a cWebForm Set piColumnSpan to 2 Set psLabel to "Label 1:" End_Object Object oGetZipButton is a cWebButton Set piColumnSpan to 1 Set piColumnIndex to 3 Set psCaption to "get zip" Procedure OnClick String sValue // test if this is read from db before show (probably not) WebGet psValue of oCustomer_Zip to sValue Send ShowInfoBox ("customer zip ="+sValue) End_Procedure End_Object Object oUpdateRowButton is a cWebButton Set piColumnSpan to 1 Set piColumnIndex to 4 Set psCaption to "update row" Set psToolTip to "Change the state for current row, if 'TX' to 'NY', if 'NY' to 'TX'" Procedure OnClick String sState Boolean bChanged Integer iRow WebGet piCurrentRowIndex of oCustomerWebGrid to iRow Get Field_Current_Value of oCustomer_DD Field Customer.State to sState If (sState='TX') Begin Set Field_Changed_Value of oCustomer_DD Field Customer.State to "NY" End Else If (sState='NY') Begin Set Field_Changed_Value of oCustomer_DD Field Customer.State to "TX" End Get Field_Changed_State of oCustomer_DD Field Customer.State to bChanged If (bChanged) Begin Send Request_Save of oCustomer_DD Send RefreshDataFromSelectedRow of oCustomerWebGrid End End_Procedure End_Object Object oHintLabel is a cWebLabel Set psCaption to "Double click=enabled" Set piColumnSpan to 2 Set piColumnIndex to 7 End_Object Object oClearGroupingButton is a cWebButton Set psCaption to "X Grouping" Set psToolTip to "Clear all groupings" Set piColumnIndex to 9 Set piColumnSpan to 1 Procedure OnClick Send ClearGrouping of oCustomerWebGrid End_Procedure End_Object Object oSelectedRowsButton is a cWebButton Set psCaption to "Selected Rows" Set piColumnIndex to 10 Set piColumnSpan to 2 Procedure OnClick Send GetRowSelection of oCustomerWebGrid // This triggers onSelectedRows in the grid with the actual selection. End_Procedure End_Object Object oCustomerWebGrid is a csfWebList Set piColumnIndex to 0 Set piColumnSpan to 12 Set piHeight To 400 Set pbShowToolBar To False Set pbAllowResizing To True Set pbAllowReordering To True Set pbGroupAutoCollapse to True Set pbAllowGrouping To True Set pbAllowSorting To True Set pbAllowExcelExport To True Set pbAllowPdfExport To True Set pbAllowFiltering To True Set pbServerOnRowDoubleClick to True //Set pbMultipleSelection to True Procedure OnRowDoubleClick String sRowID Send ShowInfoBox ("RowID is"*sRowID) End_Procedure Procedure OnChangeCurrentRow String sFromRowID String sToRowID String sName WebGet psValue of oCustomer_Name To sName Send ShowInfoBalloon "" ("Changed to row: "+sName) true End_Procedure Procedure OnSelectedRows String[] RowIDs Integer iItem String sText String sRowIDs Move "" To sRowIDs Move "Selected Rows: " To sText For iItem from 0 To (SizeOfArray(RowIDs)-1) Move (sRowIDs+" "+RowIDs[iItem]) To sRowIDs Loop If (sRowIDs="") Begin Move "No Rows have been selected." To sRowIDs End Move (sText+sRowIDs) To sText Send ShowInfoBalloon "" sText true End_Procedure Object oCustomer_Customer_Number is a csfWebColumn Entry_Item Customer.Customer_Number Set psCaption To "Number" Set piWidth to 50 End_Object Object oCustomer_Name is a csfWebColumn //cWebColumn (trigger DAWs error) Entry_Item Customer.Name Set psCaption to "Customer Name" Set piWidth To 196 Set psTooltip to "This is a customer name" End_Object Object oCustomer_State is a csfWebColumn Entry_Item Customer.State //Set psCaption to "St." Set psField To "State" // test with simple header tooltip, we can add this automatically if needed. Set psHeaderTemplate To 'St.' Set piWidth to 77 End_Object Object oCustomer_Zip is a csfWebColumn Entry_Item Customer.Zip Set psCaption to "Zip" Set piWidth To 71 // tested and works //Set pbVisible To False End_Object Object oCustomer_Balance is a csfWebColumn Entry_Item Customer.Balance Set psCaption to "Balance" Set piWidth to 50 //Set psFormat to "C4" End_Object Object oCustomer_Status is a csfWebColumnCheckbox Entry_Item Customer.Status Set psCaption to "Active?" Set piWidth to 50 End_Object Object oActionButtons is a csfWebColumnButton Set piWidth to 100 Set psCaption to "Dynamic buttons" Set pbDynamic to True Procedure OnClick String sButton String sRowId Forward Send OnClick sButton sRowId If (sButton="E") Begin //Move "Edit" to sButton Send PopupTheDialog of oCustomerEdit Self sRowID End Else If (sButton="D") Begin Move "Deactivate" to sButton Send ShowInfoBox ("button clicked "+sButton ) End End_Procedure Procedure OnCloseModalDialog Handle hoModalDialog String sResult Get DialogResult of hoModalDialog to sResult Send CallBackProcess "updateRow" End_Procedure Procedure OnCallbackProcessing String sAction If (sAction="updateRow") Begin Send RefreshDataFromSelectedRow of oCustomerWebGrid End End_Procedure Procedure OnLoad Forward Send OnLoad Send SetActionMode (RefProc(OnCallbackProcessing)) scModeProgress "Updating changes, please hold..." End_Procedure // Called for each row to define the buttons that need to be displayed. Procedure OnDefineButtons // Use AddButton to define a button (sID, sCaption, sCSSClass) Send AddButton "E" "Edit" "" // The Global buffer contains the right record for data aware lists If (Customer.Status = "Y") Begin Send AddButton "D" "Deactivate" "" End End_Procedure End_Object End_Object End_Object End_Object