سؤال

I have a few questions about dojox.grid.EnhancedGrid:

  1. How to get rowindexes of the selected row?
  2. How to remove a row by its rowIndex?
  3. How do I check if a row is selected or not?

I have tried removeSelectedRows() and rowRemoved(inRowIndex), but I couldn't make them work; my cpu usage started growing!

هل كانت مفيدة؟

المحلول

1&2 :

var items = lstNotes.selection.getSelected();
                    if (items.length) {
                        dojo.forEach(items, function(selectedItem) {
                            if (selectedItem !== null) {
                                notesStore.deleteItem(selectedItem);
                            }
                        });
                    }

3: dijit.byId('grid').selection.selected[rowIndex] // returns true or fals

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top