How to make clickable a table


#1

Hi there,
in a view I built a table. I’d like that each row was clickable but how?
My try is:

<ion-view view-title="List">
	<span>N. license : {{licenses.length}}</span> 
	<button class="button button-positive" ng-click='newLicense({{customerId}})'>
			Add license</button>
	<div class='item item-divider list-inset'>
	<div class="row" >
		<div class="col">CustomerID</div>
		<div class="col">LicenceId</div>
		<div class="col">Start</div>
		<div class="col">End</div>
	</div></div>
	
<div class="item list-inset">
	<div class="row" ng-repeat="lic in licenses" href="#/tab/license/{{lic['customerId']}}/{{lic[':licenceId']}}">
		<div class="col">{{lic["customerId"]}}</div>
		<div class="col">{{lic["licenceId"]}}</div>
		<div class="col">{{lic["beginDate"]}}</div>
		<div class="col">{{lic["endDate"]}}</div>
        </div>
	</div></div>

     </ion-content>
</ion-view>

but it doesn’t work.
Hoe can I solve it?

Thank!


#2

href is an a-tag attribute…
learn html before asking -.-

In angularjs you should use ng-href for links
ionic is using the ui-router module, there you can use ui-sref-Direktive for routing:

<div class="row" ng-repeat="lic in licenses" ui-sref="STATENAME({param1: value1, ....})">...</div>

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref

or add a ngclick-function and route via $scope-Function with $state.go();
http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state