Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sapui5 修改sap.ui.table.table中的实体_Sapui5 - Fatal编程技术网

Sapui5 修改sap.ui.table.table中的实体

Sapui5 修改sap.ui.table.table中的实体,sapui5,Sapui5,我想在某一行(背景中)设置一个复选框true 我使用sap.ui.table.table。。。示例:我有十个采购订单,我想在输入字段中写入一个数字(EBELN),当我按“Enter”时,表中的一个复选框(在该行中,数字=EBELN)应该修改为“True”,焦点也应该在这一行上。如何使用参数进行搜索,尤其是如何修改参数 编辑: 视图: 我刚刚创建了一个小的。在事件处理程序中,它循环遍历所有行,将输入的值与行中的值进行比较,并相应地设置复选框: onPress : function(event) {

我想在某一行(背景中)设置一个复选框true

我使用sap.ui.table.table。。。示例:我有十个采购订单,我想在输入字段中写入一个数字(EBELN),当我按“Enter”时,表中的一个复选框(在该行中,数字=EBELN)应该修改为“True”,焦点也应该在这一行上。如何使用参数进行搜索,尤其是如何修改参数

编辑: 视图:

我刚刚创建了一个小的。在事件处理程序中,它循环遍历所有行,将输入的值与行中的值进行比较,并相应地设置复选框:

onPress : function(event) {
    // this gets the value of the input field
    let value = this.byId("inEbeln").getValue();
    if (!value || value.length === 0) {
        return;
    }
    // loop through all rows and compare the entered value with the value in the row
    let rows = this.byId("table").getRows();
    for (let i = 0; i < rows.length; i += 1) {
        let row = rows[i];
        let cells = row.getCells();
        // cells[0] contains the Checkbox
        // cells[1] contains the Text with Ebeln
        cells[0].setSelected(value === cells[1].getText());
    }
}
onPress:功能(事件){
//这将获取输入字段的值
让value=this.byId(“inEbeln”).getValue();
如果(!value | | value.length==0){
返回;
}
//循环遍历所有行,并将输入的值与行中的值进行比较
让rows=this.byId(“表”).getRows();
for(设i=0;i
您可以通过绑定来实现这一点,但欢迎您提供有关实现的更多详细信息:)我如何绑定它?我有一个sap.ui.tabe.Table。在一个文本字段中,我写下了Ebeln。通过按enter键,我想搜索条目并修改它。
var sEbeln=this.getView().byId(“textfield”).getValue();var oRouter=sap.ui.core.UIComponent.getRouterFor(this);var oTable=this.getView().byId(“tableItemsId”)现在我有了表和sEbeln,我如何搜索这个ebeln?将文本字段内容绑定到类似{/value}的东西,然后将复选框的选中状态绑定到类似{=${/value}===${number}}的东西(如果没有关于实现的更多信息,我无法给出正确的代码:p)我添加了一些代码,我不明白:/。。
onPress : function(oEvent) {
                var that = this;
                var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
                // Here I want to modify the row in the table "tableItemsId", where Ebeln = "inEbeln"
onPress : function(event) {
    // this gets the value of the input field
    let value = this.byId("inEbeln").getValue();
    if (!value || value.length === 0) {
        return;
    }
    // loop through all rows and compare the entered value with the value in the row
    let rows = this.byId("table").getRows();
    for (let i = 0; i < rows.length; i += 1) {
        let row = rows[i];
        let cells = row.getCells();
        // cells[0] contains the Checkbox
        // cells[1] contains the Text with Ebeln
        cells[0].setSelected(value === cells[1].getText());
    }
}