Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use cCustomerDataDictionary.DD Use csfWebList.pkg Use csfWebColumn.pkg Use cJsonObject.pkg Object oSyncFusionGridCustomerListManually is a cWebView Set psCaption to "SyncFusion Grid manually load data from Customer table" Set pbServerOnShow to True // must be set for OnShow to fire // 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 0 Set psLabel to "Label 1:" End_Object Object oCustomerWebList is a csfWebList Set piColumnIndex to 0 Set piColumnSpan to 12 Set piHeight To 400 Set pbAllowSorting To True Set pbAllowPdfExport To True Set pbAllowExcelExport To True Set pbShowToolBar To False Set peDbGridType to gtManual Set pbDataAware to False Object oCustomer_Customer_Number is a csfWebColumn Set psCaption To "Number" Set psField To "Number" // The Fields must match up with the names of the rows in the JSON Set piWidth to 50 End_Object Object oCustomer_Name is a csfWebColumn Set psCaption to "Customer Name" Set psField To "Name" Set piWidth to 196 End_Object Object oCustomer_State is a csfWebColumn Set psCaption to "St." Set psField To "State" Set piWidth to 77 End_Object Object oCustomer_Zip is a csfWebColumn Set psCaption to "Zip" Set psField To "Zip" Set piWidth to 71 End_Object Object oCustomer_Status is a csfWebColumn Set psCaption to "Active?" Set psField To "Status" Set piWidth to 50 End_Object // 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 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 If (Customer.State<>"CA") Begin // 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" jsonTypeString (Rtrim(Customer.Status)) Send AddMember of hoJSON hoRow End Send Destroy of hoRow Send Request_Read of hoServer GT iFile 1 Move (Found) to bFound Loop // Generate JSON string //Set peWhiteSpace of hoJson to jpWhitespace_Spaced //Get Stringify of hoJson to sJson //Showln sJson Send LoadJSONData hoJson Send Destroy Of hoJson End_Procedure Procedure OnChangeCurrentRow String sFromRowID String sToRowID send none End_Procedure End_Object End_Object Procedure OnShow Forward Send OnShow Send LoadCustomerData Of oCustomerWebList End_Procedure End_Object