Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use csfWebList.pkg Use csfWebColumn.pkg Use csfWebColumnLink.pkg Use csfWebColumnImage.pkg Use cCustomerDataDictionary.dd Use cSalesPersonDataDictionary.dd Use cOrderHeaderDataDictionary.dd Use cOrderDetailDataDictionary.dd Use cWebButton.pkg Use OrderHeaderPopup.wo Use FileUploadTest.wo Object oSyncFusionOrderSwedish is a cWebView Set psCaption to "Projektsammandrag" Set pbServerOnShow to True Object oCustomerDataDictionary is a cCustomerDataDictionary End_Object Object oSalesPersonDataDictionary is a cSalesPersonDataDictionary End_Object Object oOrderHeaderDataDictionary is a cOrderHeaderDataDictionary Set DDO_Server to oCustomerDataDictionary Set DDO_Server to oSalesPersonDataDictionary End_Object Set Main_DD to oOrderHeaderDataDictionary Set Server to oOrderHeaderDataDictionary Object oWebMainPanel is a cWebPanel Set piColumnCount to 12 Object oOrderHeader_Order_Number is a cWebForm Entry_Item OrderHeader.Order_Number Set piColumnSpan to 3 Set psLabel to "Order Number" Set pbPromptButton to True Procedure OnPrompt Forward Send OnPrompt Send Popup of oOrderWebLookup Self //Standard webOrder OrderHeader lookup. End_Procedure End_Object Object oResetLayoutButton is a cWebButton Set piColumnSpan to 2 Set piColumnIndex to 3 Set psCaption to "reset Layout" Set psToolTip to "You will need to reload this page to get it to reset" Procedure OnClick // this only partly works, you'll have to reload the page as there's too // many problems in getting this to work (grouping, ordering.. ) Send ResetLayout of oOrderList End_Procedure End_Object Object oToggleToolbarButton is a cWebButton Set piColumnSpan to 2 Set psCaption to "Toggle toolbar" Set piColumnIndex to 5 Set psToolTip to "Toggle enabled state on toolbar button" Procedure OnClick Boolean bState WebGet pbToolBarButtonState Of oOrderList To bState Move (not(bState)) To bState Send EnableToolBarItem of oOrderList "myItem" bState // the following is not a custom style toolbar button, so you have to be specific on that. Send EnableToolBarItem of oOrderList "Test123" bState false WebSet pbToolBarButtonState Of oOrderList To bState End_Procedure End_Object Object oUploadButton is a cWebButton Set piColumnSpan to 2 Set psCaption to "File Upload" Set piColumnIndex to 7 Procedure OnClick String sRowID Move "" To sRowID Send PopupTheDialog of oFileUploadTest Self sRowID End_Procedure End_Object Object oOrderList is a csfWebList Set piColumnIndex to 0 Set piColumnSpan to 12 Set Server to oOrderHeaderDataDictionary Set pbAllowFiltering to True Set pbAllowGrouping to True Set pbAllowPdfExport to True Set pbAllowReordering to True Set pbAllowResizing to True Set pbAllowSorting to True Set pbFillHeight to True Set pbShowColumnChooser to True Set pbShowGroupedColumn to True Set pbShowColumnMenu to True Set pbAllowExcelExport to True Set pbServerOnCreated to True Set pbShowToolBar to True Set psLocale to "sv" // Enable virtualization works well, but has the side effect that a showInfoBox does not // sit on top of the table content any more. Set pbEnableVirtualization to False { WebProperty=ServerSession } Property tGridLayout ptGridLayout { WebProperty=Client } Property Boolean pbToolBarButtonState Object oNumber is a csfWebColumnLink Entry_Item OrderHeader.Order_Number Set psCaption to "No." Set piWidth to 35 Set psField to "id" Procedure OnClick String sRowID String sCellValue Send PopupTheDialog of oOrderHeaderPopup Self sRowID End_Procedure Procedure OnCloseModalDialog Handle hoModalDialog Boolean bCanceled String sRowID RowId riRowID WebGet pbCanceled of hoModalDialog to bCanceled If (bCanceled=False) Begin WebGet psCurrentRowId of oOrderList to sRowID Send Clear_All of oOrderHeaderDataDictionary Send UpdateList of oOrderList Move (DeserializeRowID(sRowID)) To riRowID Send FindByRowId of oOrderHeaderDataDictionary OrderHeader.File_Number riRowID End End_Procedure End_Object Object oDate is a csfWebColumn Entry_Item OrderHeader.Order_Date Set psCaption to "Date" Set piWidth to 50 End_Object Object oCustomer is a csfWebColumn Entry_Item Customer.Name Set psCaption to "Customer" Set piWidth to 100 End_Object Object oSalesP is a csfWebColumn Entry_Item SalesPerson.Name Set psCaption To "Sales Person" Set psField To "salesPerson" Set piWidth to 100 End_Object Object oAmount is a csfWebColumn Entry_Item OrderHeader.Order_Total Set psCaption To "Amount" Set psField to "verklint" Set piWidth To 50 Set psMask To "########" Set psHeaderTextAlign to "Right" Set psTextAlign To "Right" //Set psFormat To "C2" Set psType To "number" //Set pbEnableGroupByFormat To False End_Object Object oLastDtlNum is a csfWebColumn Entry_Item OrderHeader.Last_Detail_Num Set psCaption To "Num" Set psField to "verklkost" Set piWidth To 50 Set psMask To "########" Set psHeaderTextAlign to "Right" Set psTextAlign To "Right" //Set psFormat To "C2" Set psType To "number" //Set pbEnableGroupByFormat To False End_Object Object oStaticImageCol is a csfWebColumnImage Set psImageUrl to "Images/Order.png" Set psCaption to "Icon" Set psField To "orderImg" Set piWidth To 30 Set pbServerOnClick to True Procedure OnClick String sImage String sRowId String sCustomer Forward Send OnClick sImage sRowId WebGet psValue Of oCustomer To sCustomer //WebSet psCaption Of oHintLabel To sCustomer // show info box is displayed partly under the grid when the EnableVirtualization is on. // ** Works fine now with fixes in application.css Send ShowInfoBox ("You've clicked the image, for "+sCustomer) End_Procedure End_Object Object oTotalCount is a csfWebColumnAggregate Set psType to "Count" Set psField to "id" Set psFooterTemplate to "Antal: ${Count}" End_Object Object oTotVerklInt is a csfWebColumnAggregate Set psType to "Sum" Set psField to "verklint" Set psFooterTemplate to "${Sum}" Set psFormat to "C0" End_Object Object oTotVerklKost is a csfWebColumnAggregate Set psType to "Sum" Set psField to "verklkost" Set psFooterTemplate to "${Sum}" Set psFormat to "C0" End_Object Object oTotVerklTB is a csfWebColumnAggregate Set psType to "Sum" Set psField to "tb" Set psFooterTemplate to "${Sum}" Set psFormat to "C0" End_Object Object oTotVerklTG is a csfWebColumnAggregate Set psType to "Sum" Set psField to "tg" Set psFooterTemplate to "${Sum}" //Set psFormat to "P2" End_Object Procedure OnCreateToolBarItems tsfWebListToolBarCustomItem myItem //Send AddToolBarItem "Add" //Send AddToolBarItem "Edit" //Send AddToolBarItem "Delete" Move "myItem" To myItem.sId Move "This is my custom Item" to myItem.sTooltipText Move "e-excelexport" To myItem.sPrefixIcon // Looks like it is documented here on how-to add your own icons (or use theirs): // https://ej2.syncfusion.com/documentation/appearance/icons/ Move "my Item" To myItem.sText Send AddToolBarItem "Test123" // Note that if you create a toolbar item with a space in the label this way // that you cannot enable/disable it. // Then you should create a custom Item: Send AddToolbarCustomItem myItem WebSet pbToolBarButtonState To True //Send AddToolBarButton myButton //Send AddToolBarButton toggleButton Send AddToolBarItem "Search" Send AddToolbarItem "ExcelExport" Send AddToolbarItem "CsvExport" Send AddToolbarItem "PdfExport" End_Procedure Procedure onToolBarButtonClick String sID Send ShowInfoBox ("Clicked toolbar button "+sID) End_Procedure Procedure OnLayoutChanged tGridLayout Layout Integer iCount Boolean bState WebSet ptGridLayout to Layout // Disable the export buttons if there's a group because it won't work // See also bugreport: https://projects.vdf-guidance.com/issues/176 Move (SizeOfArray(Layout.groups)) To iCount If (iCount=0) ; Move True to bState Else ; Move False To bState Send EnableToolBarItem "ExcelExport" bState false Send EnableToolBarItem "PdfExport" bState false Send EnableToolBarItem "CsvExport" bState false End_Procedure Procedure OnRender tGridLayout Layout WebGet ptGridLayout to Layout Send RestoreLayout Layout End_Procedure End_Object End_Object Procedure OnShow Forward Send OnShow // Send LoadTotalCount // It is not needed to send UpdateList when you use a dbEnabled sfWebList as it will cause the // list to be filled twice (and thus slows it down) // Send UpdateList of oOrderList End_Procedure End_Object