Skip to Content
0
Former Member
May 03, 2018 at 03:29 PM

Get element inside a table on controller

69 Views

Hello I am trying to get an element on controller function. Easy task right? I am having problems to deal with it.

XML Code:

<Table id="tableLlaves" growingScrollToLoad="true" growing="true" items="{modelDefault>/DetalleStockDuplicadosSet}" headerText="Llaves (*)">
 <columns>
	<Column width="100px" minScreenWidth="Tablet" demandPopin="true"> 
		<header>
			<Label text="Tipo Llave"/>
		</header>
	</Column>
	<Column width="100px" minScreenWidth="Tablet" demandPopin="true"> 
		<header>
			<Label text="Confirmar"/>
		</header>
	</Column>
 </columns>
 <items>
   <ColumnListItem>
	 <cells>
		<Text text="{modelDefault>Descripcion}"/>
		<CheckBox id="checkBox" selected="{modelDefault>Confirmada}" enabled="{path: 'modelDefault>/enabled', formatter: '.checkBox'}" select="onCheck"/>
</cells>
                       </ColumnListItem>
                    </items>
           	</Table>

JS Function:

checkBox: function (oItem) {
	//var o = s.getSource();
	//var t = s.getMetadata().getName();
	
	if(oItem) {
		//var o = oItem.getSource();
		var a = oItem.getBindingContext();
		
		return false;
	}
	
	console.log(oItem);
	return this.getView().getModel("modelDefault").getProperty("/enabled");
},

The method getSource is not working either getBindingContext.

Somebody knows some way to get the checkbox which I do click on?

Thanks.