mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 02:58:20 +08:00
Xml parser factory plain + UI table extension (#735)
* xml parser factory plain + ui table extension * abaplint fix
This commit is contained in:
parent
a3f2a714ec
commit
c2d6c157b4
|
@ -27,7 +27,8 @@ CLASS Z2UI5_CL_FW_CC_FACTORY IMPLEMENTATION.
|
|||
z2ui5_cl_fw_cc_geolocation=>get_js( ) &&
|
||||
Z2UI5_CL_FW_CC_DEV_TOOLS=>get_js( ) &&
|
||||
z2ui5_cl_fw_cc_file_uploader=>get_js( ) &&
|
||||
z2ui5_cl_fw_cc_multiinput=>get_js( ).
|
||||
z2ui5_cl_fw_cc_multiinput=>get_js( ) &&
|
||||
z2ui5_cl_fw_cc_uitableext=>get_js( ).
|
||||
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
|
|
@ -61,8 +61,6 @@ CLASS z2ui5_cl_fw_cc_scrolling IMPLEMENTATION.
|
|||
|\n| &&
|
||||
` oControl.setProperty("setUpdate", false);` && |\n| &&
|
||||
` var items = oControl.getProperty("items");` && |\n| &&
|
||||
* ` var resBinding = new sap.ui.model.ListBinding(sap.z2ui5.oView.getModel( ), "/EDIT/MT_SCROLL" );` && |\n| &&
|
||||
* ` resBinding.attachChange( ( ) => { alert( "Model Change" ); } ); ` &&
|
||||
` if(!items){return;};` && |\n| &&
|
||||
|\n| &&
|
||||
` setTimeout( (oControl) => { ` && |\n| &&
|
||||
|
|
61
src/01/03/z2ui5_cl_fw_cc_uitableext.clas.abap
Normal file
61
src/01/03/z2ui5_cl_fw_cc_uitableext.clas.abap
Normal file
|
@ -0,0 +1,61 @@
|
|||
CLASS z2ui5_cl_fw_cc_uitableext DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
class-METHODS get_js
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_fw_cc_uitableext IMPLEMENTATION.
|
||||
|
||||
METHOD get_js.
|
||||
|
||||
result = `jQuery.sap.declare("z2ui5.UITableExt"); sap.ui.require([` && |\n| &&
|
||||
` "sap/ui/core/Control"` && |\n| &&
|
||||
`], (Control) => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
|\n| &&
|
||||
` return Control.extend("z2ui5.UITableExt", {` && |\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` properties: {` && |\n| &&
|
||||
` tableId: { type: "String" }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` init() {` && |\n| &&
|
||||
` sap.z2ui5.onBeforeRoundtrip.push(this.readFilter.bind(this));` && |\n| &&
|
||||
` sap.z2ui5.onAfterRoundtrip.push(this.setFilter.bind(this));` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` readFilter() {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` let id = this.getProperty("tableId");` && |\n| &&
|
||||
` let oTable = sap.z2ui5.oView.byId(id);` && |\n| &&
|
||||
` this.aFilters = oTable.getBinding().aFilters;` && |\n| &&
|
||||
` } catch (e) { };` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` setFilter() {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` setTimeout( (aFilters) => { let id = this.getProperty("tableId");` && |\n| &&
|
||||
` let oTable = sap.z2ui5.oView.byId(id);` && |\n| &&
|
||||
` oTable.getBinding().filter(aFilters);` && |\n| &&
|
||||
` } , 100 , this.aFilters); } catch (e) { };` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
|\n| &&
|
||||
` renderer(oRM, oControl) {` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});`.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
16
src/01/03/z2ui5_cl_fw_cc_uitableext.clas.xml
Normal file
16
src/01/03/z2ui5_cl_fw_cc_uitableext.clas.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_FW_CC_UITABLEEXT</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>cc - sap.ui.table extension</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
<UNICODE>X</UNICODE>
|
||||
</VSEOCLASS>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -12,6 +12,11 @@ public section.
|
|||
preferred parameter CLIENT
|
||||
returning
|
||||
value(RESULT) type ref to Z2UI5_CL_XML_VIEW .
|
||||
|
||||
class-methods FACTORY_plain
|
||||
returning
|
||||
value(RESULT) type ref to Z2UI5_CL_XML_VIEW .
|
||||
|
||||
class-methods FACTORY_POPUP
|
||||
importing
|
||||
!T_NS type Z2UI5_IF_CLIENT=>TY_T_NAME_VALUE optional
|
||||
|
@ -4222,6 +4227,15 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD factory_plain.
|
||||
|
||||
result = NEW #( ).
|
||||
|
||||
result->mo_root = result.
|
||||
result->mo_parent = result.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD factory.
|
||||
|
||||
result = NEW #( ).
|
||||
|
|
|
@ -5,7 +5,6 @@ CLASS z2ui5_cl_xml_view_cc DEFINITION
|
|||
|
||||
PUBLIC SECTION.
|
||||
|
||||
|
||||
METHODS multiinput
|
||||
IMPORTING
|
||||
!showclearicon TYPE clike OPTIONAL
|
||||
|
@ -26,6 +25,12 @@ CLASS z2ui5_cl_xml_view_cc DEFINITION
|
|||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
|
||||
|
||||
METHODS uitableext
|
||||
IMPORTING
|
||||
!tableid TYPE clike OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
|
||||
|
||||
METHODS camera_picture
|
||||
IMPORTING
|
||||
!id TYPE clike OPTIONAL
|
||||
|
@ -343,7 +348,8 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
METHOD multiinput.
|
||||
|
||||
result = mo_view->_generic( name = `MultiInput` ns = `z2ui5`
|
||||
result = mo_view.
|
||||
mo_view->_generic( name = `MultiInput` ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `tokens` v = tokens )
|
||||
( n = `showClearIcon` v = z2ui5_cl_util_func=>boolean_abap_2_json( showclearicon ) )
|
||||
( n = `showValueHelp` v = z2ui5_cl_util_func=>boolean_abap_2_json( showvaluehelp ) )
|
||||
|
@ -361,4 +367,12 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
|
|||
( n = `class` v = class ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD uitableext.
|
||||
|
||||
result = mo_view->_generic( name = `UITableExt` ns = `z2ui5`
|
||||
t_prop = VALUE #( ( n = `tableId` v = tableId )
|
||||
) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
Loading…
Reference in New Issue
Block a user