javascript

  • ‘s the function which display the result for the cards even if both of them aren’t selected
  • Stack Overflow works best with JavaScript enabled
  • I’m trying to find a way through ngclass conditions to check all boxes automatically when the user deselect them both .
  • i’m trying to get the id for each selected card , then select all boxs when no card is selected , any idea how this can be achieved – Amr Ayoub 22 hours ago
  • GetAllFromDB(“Card”).then(function(result) { self.cards.length = 0; if (result.rows.length > 0) { var addAllCardsToFilter = false; // first time and when all cards are deselected if ($scope.transactionFilter.cards.length === 0) addAllCardsToFilter = true; for (var r = 0; r < result.rows.length; r++) { self.cards.push(result.rows.item(r)); // initial fill and when all card were deselected - avoid empty display if (addAllCardsToFilter) $scope.transactionFilter.cards.push(self.cards[r].g_id); if ($scope.transactionFilter.cards.indexOf(self.cards[r].g_id) > -1) self.cards[r].

I’m trying to find a way through ngclass conditions to check all boxes automatically when the user deselect them both .
to make it clear , there’re two item in cards as it shown in the image , when the user deselect first one , then the other card will be checked , then when the user deselect the second one , It should automatically select both of them again .

@Amrayoub10: @dinesh__devkota Hi Dinesh,hope you’re doing great
you helped me before on stackoverflow and I need your help again

I’m trying to find a way through ngclass conditions to check all boxes automatically when the user deselect them both . to make it clear , there’re two item in cards as it shown in the image , when the user deselect first one , then the other card will be checked , then when the user deselect the second one , It should automatically select both of them again .

I tried the code below but it didn’t give the desired result

HTML

here’s the function which display the result for the cards even if both of them aren’t selected

javascript