Hi,
I am using UltraWebGrid to display the data. I have attached BeforeSelectChangeHandler and AfterSelectChangeHandler events in javascript to select rows and display information about it in a popup. Everything is working fine as expected.
Now, I have to make a small change to this ultrawebgrid. I want to keep the existing functionality of the row select events except for one column. Whenever, user clicks on other columns, I want to fire BeforeSelectChangeHandler and AfterSelectChangeHandler events except for one column.
I attached onclick event to that column but it fires BeforeSelectChangeHandler and AfterSelectChangeHandler events. If I click on the column of the selected row, than my onclick event is fired but when I click that column of any other row, BeforeSelectChangeHandler and AfterSelectChangeHandler are fired.
Please let me know Is it possible to achieve the functionality that I am looking for. If yes, could also please provide me a basic working Idea.
And also, please let me know if the question is unclear.
Thank you.
Hi Santosh,
Thank you for posting on our forums.
You should be able to return true or false, depending on the column you're on, to cancel the BeforeSelectChange event. An example of how this looks is available here.
Please let me know if you have any questions regarding this matter.
Thanks Jose for the quick reply. I will try to implement the same logic in my application.
Since, my BeforeSelectChangeHandler and AfterSelectChangeHandler accept tableName and row id, is it possible for me to know which column is clicked.
Here is the code for afterselectchanged event
function afterSelectChanged(tableName, id) { // Do something
// Is it possible for me to know which column is clicked here? }
function function beforeSelectChanged(tableName, id) {
//Do something
//How to get which cell is clicked.
}
Thanks in advance.
Santosh,
The id that is past in will either be for the td or the tr that is associated with the cell or the row. I am not sure if this changes depending on the selections options you have enabled in the grid. If it is the td, then igtbl_getCellById will return the grid cell object and from that you could determine the column by looking at the Column property. The following resources may be helpful:
Let us know if you have any questions.
Thanks Alan.
I am able to use grid as I wanted. I had to use CellSelectionChanged(gridName, CellID, button) event.