on 12-06-2021 11:17 AM
Hello,
i got following code:
<t:Table id="SeqSubTable" selectionMode="MultiToggle" rowSelectionChange="onSelChangeSeq" cellClick="selectText" rowActionCount="2"
visibleRowCountMode="Auto" >
<t:rowSettingsTemplate></t:rowSettingsTemplate>
<t:rowActionTemplate>
<t:RowAction></t:RowAction>
</t:rowActionTemplate>
<t:Column width="100px" sortProperty="Yield" >
<t:customData useSmartField="true">
<core:CustomData key="p13nData"
value='\{"columnKey": "Yield", "autoColumnWidth": \{ "visibleProperty": "Yield" }, "columnIndex": 3, "leadingProperty": "Yield", "sortProperty": "Yield", "description": "Gutmenge", "displayBehaviour": "descriptionOnly", "width": "360px"}' />
</t:customData>
<t:label>
<Text text="Gutmenge"/>
</t:label>
<t:template>
<Input id="yield" value="{ path: 'Yield', type: 'sap.ui.model.type.Float', formatOptions: {minFractionDigits: 3}, columnIndex: 3}" editable="true" onfocusin="selectText" />
</t:template>
</t:Column>
How can i manage to get the Cellclick? I simply want to select the text in the clicked cell (Input)?
The normal CellClick Event works JUST for the predefined fields - but not for the custom ones.
Thanks
Andreas
Thanks - the focus event works now:
sap.ui.define([
"sap/m/Input"
], function (Input) {
"use strict";
return Input.extend("CustomInput", {
metadata: {
events: {
focus: {
input : { type: "object" }
}
}
},
renderer: {},
onAfterRendering: function () {
if (sap.m.Input.onAfterRendering) {
sap.m.Input.onAfterRendering.apply(this, arguments);
}
this.$().find('input').focus(function () {
this.fireEvent('focus', { input: this });
}.bind(this));
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas,
cellClick event works if you click outside of the input box but inside the cell.
For your requirement you need to implement a click event on the input box as there is no such event implemented in the standard version of the control.
So either you extend the input control and implement/fire the click event yourself or you use a control which has such an event already available.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.