sap.m.Table中的SapUI5 Autotab

时间:2015-05-29 10:09:50

标签: javascript jquery sapui5 sap.m

美好的一天,

我想要点击jQuery.autotab,就像SCN中的这个问题一样 Auto tabbing in SAP UI5

我是javascript的新手,希望得到一些帮助。

我的表格看起来像这样

var oTable = new sap.ui.table.Table({
    selectionMode : sap.ui.table.SelectionMode.MultiToggle
 });

oTable.addColumn(new sap.ui.table.Column({
     label : 'Work Request',
     template : new sap.ui.commons.TextField({
         value : '{requestNo}',
         editable : true
     })
}));

oTable.addColumn(new sap.ui.table.Column({
    label : 'Description',
    template : new sap.ui.commons.TextField({
        value : '{description}',
        editable : true
    })
}));

SCN的答案建议查看jQuery:

$(function () {

    $('.number').autotab('filter','number');

});

$('.number') here .number is the classname.

我的问题是,我如何让这个工作?该示例使用普通文本字段,但我需要在列之间进行自动标记。

1 个答案:

答案 0 :(得分:0)

将相应的table添加到您的oTable.addStyleClass('number');

$(function () {
    $('.number').autotab('filter','number');
});

然后在 onAfterRendering()中有你的jQuery语句。

    Dim FoundString As String, MyArray() As String, MyString As String, FindVal As String, MyVal As Long, X As Long
    MyString = "ABCDBEEBIIIIFBSB"
    FindVal = "B"
    MyArray = Split(MyString, FindVal)
    FoundString = ""
    For X = LBound(MyArray) To UBound(MyArray) - 1
        MyVal = MyVal + Len(MyArray(X)) + 1
        FoundString = FoundString & CStr(MyVal) & ","
    Next
    FoundString = Left(FoundString, Len(FoundString) - 1)
    MsgBox(FoundString)