Skip to Content

Removed.Problem Solved.

Removed.Problem Solved.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 03 at 07:39 AM

    Hello, Burak. Usually, we will create a JSON array model and bind it to table component.

    step1: create JSON array and set model to this view.

    this.getView().setModel(new JSONModel(data),"testdata");

    step2: binging model to table component.

    <Table id="table" rows="{testdata>/}" enableCellFilter="true" selectionMode="None">
       <columns>
          <Column width="110px" hAlign="Left" vAlign="Top">
              <m:Label text="Area" />
                 <template>
                    <m:Text text="{testdata>area}" width="auto" maxLines="3" wrapping="true"/>
                 </template>
          </Column>
     <columns>
    

    step3: when you change the value of text you could get the value by using the following way.

    onEditRow_Press: function (oEvent) {
         var sPath = oEvent.getSource().getBindingContext("testdata").sPath;
         var oSelectedObject = this.getView().getModel("testdata").getProperty(sPath);
         console.log(oSelectedObject.area);
    }
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 04 at 01:54 AM

    Hi,

    Try getting model from table object. Like below

    Var data=oTabel.getModel().getData();
    Data.yourPropertyName;
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 02 at 10:16 PM

    Hi,

    As you didn't specify any code snippets, I made my own assumptions. The code I was using is from here .

    I pressed the "Edit" button and entered the value "dddd" into the first line (item) of column "Quantity" (see screenshot).

    screen-shot-2018-01-03-at-120542-am.png

    Now, to get this value, in the controller you do this (I could have used the predefined attribute this.oTable, but wanted to show you the full way)

    var items = this.getView().byId("idProductsTable").getItems(), //Get the visible lines of the table
         dddd = items[0].getCells()[1].getValue();   //Get the value of the first line in the second column
    

    and you got your value in dddd.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 03 at 08:08 AM

    Hello,

    Why not using SubmitChange in OData model instead of. Theoretically it will do the job for you ;)

    This will work only for an entity not a deep creation.

    Regards,

    Joseph

    Add comment
    10|10000 characters needed characters exceeded