:: Forum >>

grid events

I'm looking all over for an event to handle when a row is deleted from a grid and a row is no longer selected. I'd like to disable the delete button when this happens.

Any insight?

Thanks...
Aaron
Tuesday, November 25, 2008
I thought I should mention that I am deleting the row from the data source and then repolling the XML and then updating the grid. Ultimately what I'd like to do is disable a button when nothing is selected in the grid.
Aaron
Tuesday, November 25, 2008
Start with the grid events http://www.activewidgets.com/aw.ui.grid/

However, your description requires some logic handling. When you repoll, do you clear the button? Or do you look for a previously selected row?
Anthony
Tuesday, November 25, 2008
Anthony,

Thanks for you responce. I've been to the link you provided, but the only clear event would be onRowDeleted. The way I read it, that only fires when deleteRow() is used. Since I am not deleting rows from the grid that doesnt sound like it will work for me.

I am using the onRowClicked to enable the button:grid.onRowClicked = function(event, rowIndex){
        if (this.getRowPosition(rowIndex) >= 0){
            document.getElementById('button').disabled = "";
        }
    }


And I am also modifying the default responce of the table so it should disable the button every time the table is reloaded:var defaultResponse = table.response;
    table.response = function(xml){
        defaultResponse.call(this, xml);

        document.getElementById('button').disabled = "disabled";
            
        if(table.getCount()<=0){
            document.getElementById('button').disabled = "disabled";
        }
    }


Unfortunately, its not working as planned.

Any more ideas?

Thanks again.
Aaron
Wednesday, November 26, 2008
Er ... shouldn't you be doing -
...disabled = true
...disabled = false

instead?

Also if you use an AW button, which is a JavaScript object, you can use the object reference instead of searching for the object's ID via the document.
Anthony
Wednesday, November 26, 2008

This topic is archived.


Back to support forum

Forum search