Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: How to get row index in which field change triggered an event.

$
0
0

Hi Dhuraj,

Change: after entering some text in the field, when you are click ENTER button that time method will be call.

LiveChange: after entering each text it is triggered the method.

 

u wrote your updateTotal() in controller so this scenario use Change. if u r wrote this code in view itself then use liveChange().

 

updateTotal : function(oControlEvent){

  var oRow =  oControlEvent.getSource().getParent();

  var aCells = oRow.getCells();

  var total = 0;

//Here aCells.length-2 bec last column is total so dn't want to add

    for(var i = 2; i < aCells.length-2;i++)

    {

       var colVal =  parseInt(aCells[i].getValue());

        total = total + colVal;

    }

        aCells[aCells.length-1].setText(total);  //setText() bec u mentioned this is text view not input .

}


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>