jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Retrive DIV value from a cell using cell clik event
Tagged: Cell Click, DIV Value, jquery grid, jqxgrid
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 12 years, 1 month ago.
-
Author
-
hi ,
I have a GRID having one column and n number of rows.I am using cellrender to render the cell.
My cell rendering logic for each cell is as below
value 1value 2How can I retrive the value 1 when user click the Ist div ‘samplecellclass1’ and and retrive value2 when user click on the second div ‘samplecellclass2’.
Probably DIV is not seen in in above question .Let me write again the question:
I have a GRID having one column and n number of rows.I am using cellrender to render the cell.
My cell rendering logic for each cell contains
<div class=samplecellclass1> value1 < /div > <div class=samplecellclass2> value2 < /div>
How can I retrive the value 1 when I click the Ist div ‘samplecellclass1′ and and retrive value2 when user click on the second div ‘samplecellclass2′.
-Pius
Hi,
You can use the Grid’s “cellclick” event for getting the clicked cell value, row index and datafield.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Yes what if I want to retrive
cell1 – value1 value2
cell2- value1 value2
…..
…..
cell(n)-value1 value2As per solution provided by you , I can retrieve both value1 and value2.Is there any way , I can identify user has clicked either value1 or value2?
hi Peter ,
I am not sure if my question is confusing .So let me try to explain my question again:
I have a grid having n rows and 1 column. so there is one cell in each row.
Each cell in each row contains 2 values say: Name and mobilenumber in two spans/div like below:
cell1 — name1 mobilenumber1
cell2 — name2 mobilenumber2…..—————
…..———cell(n)-name(n) mobilenumber(n)
If I click on any cell and use ‘cellclick’ event to get clicked cell value, then I will get name2 mobilenumber2.
But my requirement is little bit different .I wanted to know the correct values on which user has is clicked.For example if user has clicked mobile number , I should be able to know know that click has been done on mobile number and not name.
-Pius Ranjan
Hi,
You may take a look at my answer in your other post: http://www.jqwidgets.com/community/topic/normal-click-event-in-the-cell/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.