The cards above are populated via a repeat and the view is not categorised. What I want to add now is the ability to append a delete flag to any of the card in any order.
Below is the code for the delete button:
<xp:link>
<span class="glyphicon glyphicon-trash pull-right text-primary"></span>
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><xp:actionGroup><xp:executeScript>
<xp:this.script><![CDATA[#{javascript:
var name=getComponent("FullName").getValue();
var vec:NotesView = database.getView("SupportTeam");
var docEv:NotesDocument = vec.getFirstDocument();
if (name == docEv.getItemValueString("FullName")) {
docEv.replaceItemValue("SupportAction", "Delete");
docEv.save();
}
}]]></xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action></xp:eventHandler>
</xp:link>
The code above works, but the delete button need to be clicked twice for it work and it has to be in the order, that is if 'Test 6' is clicked it will not delete since 'Test 5' is in the way.
I tried using the getdocumentbykey() but the view will need to be categorised which will then show multiple entries. In this case, it will display lots of blank cards.
Your help will be appreciated.
We need to see your repeat code, however, aslong as you set the var property of your repeat to something, that then makes row data available to you, so you could use something like: