Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use cWebButton.pkg Use csfWebList.pkg Use csfWebColumn.pkg Use cWebImage.pkg Use cWebGroup.pkg Use CharTranslate.pkg Object oSyncFusionGridJsonData is a cWebView Set piWidth to 0 // responsive Set psCaption to "Grid" Object oWebMainPanel is a cWebPanel Set piColumnCount To 12 Object oRefreshGridBtn is a cWebButton Set piColumnSpan to 2 Set psCaption to "Refresh Grid" Procedure OnClick //Send InitializeDefaults of oGrid Send RefreshGrid of oGrid End_Procedure End_Object Object oToggleResizeBtn is a cWebButton Set piColumnIndex to 2 Set piColumnSpan to 2 Set psCaption to "Toggle pbAllowResizing" Procedure OnClick Boolean bAllow WebGet pbAllowResizing of oGrid to bAllow WebSet pbAllowResizing of oGrid To (not(bAllow)) End_Procedure End_Object Object oGroupingBtn is a cWebButton Set piColumnIndex to 4 Set piColumnSpan to 2 Set psCaption to "Grouping" Procedure OnClick Boolean bAllow WebGet pbAllowGrouping of oGrid to bAllow WebSet pbAllowGrouping of oGrid To (not(bAllow)) End_Procedure End_Object Object oCollapseDataBtn is a cWebButton Set piColumnIndex to 6 Set piColumnSpan to 1 Set psCaption to "Collapse" Procedure OnClick Send GroupCollapseAll of oGrid End_Procedure End_Object Object oExpandDataBtn is a cWebButton Set piColumnIndex to 7 Set piColumnSpan to 1 Set psCaption to "Expand" Procedure OnClick Send GroupExpandAll of oGrid End_Procedure End_Object Object oWebGroup1 is a cWebGroup Set psCaption to "Caption" Set piColumnIndex to 0 Set piColumnSpan to 1 Set piMinHeight To 280 Set piHeight To 160 End_Object Object oGrid is a csfWebList Set piColumnIndex to 1 Set piColumnSpan to 11 //Set piMinHeight To 280 //Set piHeight To 160 Set pbDataAware To False Set pbAllowResizing To True Set pbAllowReordering To True Set pbAllowGrouping To True Set pbAllowSorting To True Set pbAllowExcelExport To True Set pbAllowPdfExport To True Set pbAllowFiltering To True Set pbShowColumnMenu To True //Set pbShowGroupSettingsDropArea To False Set pbFillHeight to True //Set psLocale to "sv" Object oOrderIDColumn Is a csfWebColumn Set psField To "OrderID" Set psCaption To "Order ID" Set piMinWidth to 120 Set piWidth To 200 Set piMaxWidth to 300 Set psTextAlign To "Right" Set pbShowInColumnChooser to False Set pbAllowGrouping to False End_Object Object oCustomerNameColumn Is a csfWebColumn Set psField To "CustomerName" Set psCaption To "Customer Name" Set piMinWidth to 8 Set piWidth To 200 Set pbShowInColumnChooser to False End_Object Object oOrderDateColumn Is a csfWebColumn Set psField To "OrderDate" Set psCaption To "Order Date" Set piMinWidth to 8 Set piWidth To 200 Set psTextAlign To "Right" Set psFormat to "dd/MM/yyyy" End_Object Object oFreightColumn Is a csfWebColumn Set psField To "Freight" Set psCaption To "Freight" Set piMinWidth to 8 Set piWidth To 150 Set psFormat to "C2" Set psTextAlign To "Right" Set psType to "number" Set pbAllowGrouping to False End_Object Object oShipNameColumn Is a csfWebColumn Set psField To "ShipName" Set psCaption To "Ship Name" Set piMinWidth to 8 Set piWidth To 300 End_Object Object oShippedDateColumn Is a csfWebColumn Set psField To "ShippedDate" Set psCaption To "Shipped Date" Set piWidth To 200 Set psFormat to "dd/MM/yyyy" Set psTextAlign To "Right" Set pbAllowResizing to False End_Object Object oShipCountryColumn Is a csfWebColumn Set psField To "ShipCountry" Set psCaption To "Ship Country" Set piMinWidth to 8 Set piWidth To 200 End_Object Object oShipCityColumn Is a csfWebColumn Set psField To "ShipCity" Set psCaption To "Ship City" Set piMinWidth to 8 Set piWidth To 200 End_Object Object oOrderIDAggregate Is a csfWebColumnAggregate Set psType To "Sum" Set psField To "OrderID" Set psFormat To "C2" Set psFooterTemplate To "TOTAL:" End_Object Object oFreightAggregates Is a csfWebColumnAggregate Set psType To "Sum" Set psField To "Freight" Set psFormat To "C2" Set psFooterTemplate To "${Sum}" End_Object Object oGroupFreightAggregates Is a csfWebColumnAggregate Set psType To "Sum" Set psField To "Freight" Set psFormat To "C2" Set psGroupFooterTemplate To "${Sum}" End_Object Send AddGroupSettingsColumn "ShipCountry" Send AddToolBarItem "Search" Procedure onPostConfigureGrid Boolean bOK Handle hoData UChar[] ucData Get LoadJsonDataFile To ucData Get Create (RefClass(cJsonObject)) To hoData Get ParseUtf8 Of hoData ucData To bOK If (bOK) Begin Send LoadJsonData hoData End Send Destroy of hoData End_Procedure End_Object Function LoadJsonDataFile Returns UChar[] Boolean bFileExists Integer iChannel Integer iLine String sLine String sPath String sFileName UChar[] ucData Move "demoData.txt" To sFilename Get psDataPath Of (phoWorkspace(ghoApplication)) To sPath Move (sPath+(If(Right(sPath,1)<>"\","\",""))) To sPath Move (sPath+sFileName) To sFileName File_Exist sFileName bFileExists If (bFileExists) Begin Move 0 To iLine Move (Seq_New_Channel()) To iChannel Direct_Input Channel iChannel sFileName Read_Block Channel iChannel ucData -1 Close_Input Channel iChannel Send Seq_Release_Channel iChannel End Function_Return ucData End_Function End_Object End_Object