Tuesday, May 26, 2020

Kony segment right to left swipe show options

Call the below line in init of the form


  tmpMainFlexName.addGestureRecognizer(constants.GESTURE_TYPE_SWIPE,
                                            {fingers: 1},
                                            swipeGestureHandler); //tmpMainFlexName is the segment template name

Function for the swipe operation handler:


function swipeGestureHandler(widgetInfo,gestureInfo,context){
  var mswipeDirection = gestureInfo.swipeDirection;
  var secIndex = context["sectionIndex"];
  var rowIndex = context["rowIndex"];
  var curRowData = formname.segmentName.data[rowIndex];
  if(gestureInfo.swipeDirection == 1){ // Right to left direction swipe
    curRowData["flxSwip"] = {left:"-10%"};  //flxSwip is the secondary flex which is having content
  }else if(gestureInfo.swipeDirection == 2){  // left to right direction swipe
    curRowData["flxSwip"] = {left:"0%"};
  }
  formname.segmentName.setDataAt(curRowData,rowIndex);   
}

Kony hide default loading indicator

kony.application.setApplicationBehaviors({"hideDefaultLoadingIndicator":true});