optikalefx / OpenJS-Grid

OpenJS Grid is the easiest jQuery Grid ever. With very little work you can have a data grid that can do everything from sorting and searching to complex database queries. Best of all, its open source. So you can learn how it's all done.
http://square-bracket.com/openjs
MIT License
96 stars 46 forks source link

How to exclude rowclick to a specific cell #13

Closed haroldgarcia23 closed 11 years ago

haroldgarcia23 commented 11 years ago

Hello

I am using the function RowClick to create a pop windows but I what to exclude the function to a link in a cell.

Thanks

optikalefx commented 11 years ago

Hi, what do you mean "exclude the function"? Thanks!

haroldgarcia23 commented 11 years ago

I am using the rowclick to create a pop up window that have detail information but i have link in a cell that the target is blank when i press the link the grid also open the pop up windows and i what to exclude that link to avoid pop up window. On Feb 20, 2013 3:09 PM, "Sean Clark" notifications@github.com wrote:

Hi, what do you mean "exclude the function"? Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/optikalefx/OpenJS-Grid/issues/13#issuecomment-13850146.

optikalefx commented 11 years ago

You just need to have a click event on the link and do event.stopPropagation() That will allow the click on the link but won't do the click on the row.

OR - you can check e.target inside of your rowClick function to see if you click the row, or the link tag.

haroldgarcia23 commented 11 years ago

Hello Sean Thanks for your quick response.

I try with the click event but when the grid complete i think is override the click event. i am not an expert in Java Script how can implement e.target in rowclick function

this is a copy of my code:

rowClick: function () { console.log("This Row has id " + $(this).attr("primary_key")); Messi.load('PopInfo.aspx?docID=' + $(this).attr("primary_key"), { title: 'Case Information Detail', buttons: [{ id: 0, label: 'Close', val: 'X'}] }); } thanks

On Wed, Feb 20, 2013 at 3:50 PM, Sean Clark notifications@github.comwrote:

You just need to have a click event on the link and do event.stopPropagation() That will allow the click on the link but won't do the click on the row.

OR - you can check e.target inside of your rowClick function to see if you click the row, or the link tag.

— Reply to this email directly or view it on GitHubhttps://github.com/optikalefx/OpenJS-Grid/issues/13#issuecomment-13852460.

optikalefx commented 11 years ago

Try this first

rowClick: function (e) {
    e.stopPropagation();
haroldgarcia23 commented 11 years ago

I try it but stop the complete row click function but I am trying to create a If stamen and extract the ID of the Field that way I think will work the e.stopPropgation for only on field.

I insert a ID identifier in table

Received Date

I am using in the JavaScript e.target.id but no look.

Thanks for help

On Wed, Feb 20, 2013 at 11:22 PM, Sean Clark notifications@github.comwrote:

Try this first rowClick: function (e) { e.stopPropgation();

— Reply to this email directly or view it on GitHubhttps://github.com/optikalefx/OpenJS-Grid/issues/13#issuecomment-13870917.

optikalefx commented 11 years ago

Hey, Sorry I'm having a tough time understanding your last message. Are you not sure where to put the e.stopPropagation() ?