Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use cCustomerDataDictionary.DD Use csfWebList.pkg Use csfWebColumn.pkg Use cJsonObject.pkg Use cWebButton.pkg Use cWebDynamicObjectContainer.pkg Object oDynamicListDemo is a cWebView //Set piWidth to 700 Set psCaption to "Dynamic Web List Demo" // 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 Set pbFillHeight to True Object oWebDynamicChartContainer is a cWebDynamicObjectContainer Set piColumnCount to 12 Set pbFillHeight to True // load customized static data into the datasource. This shows how you can populate a DEO grid // with custom data which bypasses the normal cached / constrained finding the datasource // normally does. Procedure LoadCustomerData Handle hoGrid Handle hoServer hoJSON hoRow Boolean bFound Integer iFile //String sJson Get Create (RefClass(cJsonObject)) to hoJSON Send InitializeJsonType of hoJSON jsonTypeArray Get Main_DD to hoServer Get Main_File of hoServer to iFile Send Request_Read of hoServer FIRST_RECORD iFile 1 Move (Found) to bFound While bFound Get Create (RefClass(cJsonObject)) to hoRow Send InitializeJsonType of hoRow jsonTypeObject // creates a datasourcerow based on current buffer data // // Not required to add a rowid as our library will add it automatically. //Send SetMemberValue of hoRow "_rid" jsonTypeString (String(Customer.Recnum)) Send SetMemberValue Of hoRow "Number" jsonTypeInteger Customer.Customer_Number Send SetMemberValue of hoRow "Name" jsonTypeString (Rtrim(Customer.Name)) Send SetMemberValue of hoRow "State" jsonTypeString (Rtrim(Customer.State)) Send SetMemberValue of hoRow "Zip" jsonTypeString (Rtrim(Customer.Zip)) Send SetMemberValue of hoRow "Status" jsonTypeBoolean (If((Rtrim(Customer.Status))="Y",True,False)) Send AddMember of hoJSON hoRow Send Destroy of hoRow Send Request_Read of hoServer GT iFile 1 Move (Found) to bFound Loop Send LoadJSONData of hoGrid hoJson Send Destroy Of hoJson End_Procedure Procedure CreateList Handle hoGrid Handle hoColumn1 hoColumn2 hoColumn3 hoColumn4 hoColumn5 // Get CreateDynamicObject (RefClass(csfWebList)) "oDynGrid" "" to hoGrid // Send InitDynamicProp of hoGrid "piColumnSpan" 12 Send InitDynamicProp of hoGrid "pbAllowResizing" true Send InitDynamicProp of hoGrid "pbAllowReordering" true Send InitDynamicProp of hoGrid "pbAllowGrouping" true Send InitDynamicProp of hoGrid "pbAllowSorting" true Send InitDynamicProp of hoGrid "pbAllowExcelExport" true Send InitDynamicProp of hoGrid "pbAllowPdfExport" true Send InitDynamicProp Of hoGrid "pbAllowFiltering" true Send InitDynamicProp Of hoGrid "peDbGridType" gtManual Send InitDynamicProp Of hoGrid "pbDataAware" false Send InitDynamicProp of hoGrid "piWidth" 1000 Send InitDynamicProp of hoGrid "piHeight" 400 Get CreateDynamicObject (RefClass(csfWebColumn)) "oCustomer_Customer_Number" "oDynGrid" to hoColumn1 Send InitDynamicProp of hoColumn1 "psCaption" "Number" //Send InitDynamicProp of hoColumn1 "psField" "Number" Set psField of hoColumn1 to "Number" Send InitDynamicProp of hoColumn1 "piWidth" 50 Get CreateDynamicObject (RefClass(csfWebColumn)) "oCustomer_Name" "oDynGrid" to hoColumn2 Send InitDynamicProp of hoColumn2 "psCaption" "Customer Name" Set psField of hoColumn2 to "Name" Send InitDynamicProp of hoColumn2 "piWidth" 196 Get CreateDynamicObject (RefClass(csfWebColumn)) "oCustomer_State" "oDynGrid" to hoColumn3 Send InitDynamicProp of hoColumn3 "psCaption" "St." Set psField of hoColumn3 to "State" Send InitDynamicProp of hoColumn3 "piWidth" 77 Get CreateDynamicObject (RefClass(csfWebColumn)) "oCustomer_Zip" "oDynGrid" to hoColumn4 Send InitDynamicProp of hoColumn4 "psCaption" "Zip" Set psField of hoColumn4 to "Zip" Send InitDynamicProp of hoColumn4 "piWidth" 71 Get CreateDynamicObject (RefClass(csfWebColumn)) "oCustomer_Status" "oDynGrid" to hoColumn5 Send InitDynamicProp of hoColumn5 "psCaption" "Active?" Set psField of hoColumn5 to "Status" Send InitDynamicProp of hoColumn5 "piWidth" 50 Send LoadCustomerData hoGrid // Send ConfigureGrid of hoGrid Send Activate End_Procedure End_Object Object oDynamicListButton is a cWebButton Set piColumnSpan to 0 Set psCaption to "Create Dynamic List" Procedure OnClick Send CreateList of oWebDynamicChartContainer End_Procedure End_Object End_Object End_Object