Getting the text value of a table cell in the same row as a clicked element

Permalink 2 users found helpful
Hi

I show the data in html table in single pages using select * from table
Now i want to edit the particular row values in different page or same table or same page i give the option edit hyper link . i attached screen shot of my page PFA.

Please any give the idea, How to achieve this task.


Thanks
Kumar

1 Attachment

 
JohntheFish replied on at Permalink Reply
JohntheFish
To do it all within the front view of concrete5, you will need to write code for a single page with the table editing for your specific table built into that code.

If you are happy to edit the table through the normal page edit mode and block editing, there are many options.

- A table within a regular content block.

- My 'Structured content' block set to display a table.

- There are many addons for displaying tables entered from the edit dialog or from csv files, some with searching, sorting and pagination.

http://www.concrete5.org/marketplace/addons/-/view/?submit_search=1...
shankumars replied on at Permalink Reply
thanks john...
I know that the normal page editing option.
I want to write code for my single page table editing. If you have any idea about this please share with me



Thanks
Kumar
JohntheFish replied on at Permalink Reply
JohntheFish
There is no quick and simple answer. Its just the long and tedious process of reading through the developer documentation, howtos and sample applications.
shankumars replied on at Permalink Reply
@john
I think you mistake my question..
I am working in web application. I am using only a single pages
my task is How to get the corresponding value of the edit link row

in my attachment I add my sample data page, in that page have
RoleID RoleName Description
1 Admin All rights Edit (hyper link)

when i click the edit link, i want pass the Roleid to another page
and i will write the sql query to update role table using where roleid

this is my task ...
juliandale replied on at Permalink Best Answer Reply
juliandale
Where you output the table, can you write the RoleID as a querystring parameter of the edit link? e.g. something like this:

<a href="edit_record.php?roleid=<?php echo $RoleID ?>">Edit</a>

That way, the Edit page can get that 'roleid' querystring parameter and use it to fetch that specific record from the database.

Is that more like what you want to do?
JohntheFish replied on at Permalink Reply
JohntheFish
Ok, I get the question now. @juliandale's solution is the easiest.

You could also use a form for each row with a hidden roleID field, or use jQuery to intercept the click and append the roleID. Both are just more complicated variations of what @juliandale has already posted.

For the single page receiving the roleID, see
http://www.concrete5.org/documentation/how-tos/developers/use-query...
JohntheFish replied on at Permalink Reply
JohntheFish
The key to the solution is to prepare each edit link in advance with the necessary query string and RoleID when you write the table.

If you don't prepare it at that point, then you will need to use the more complex variation of adapting it when a link is clicked using javascript.

Perhaps you could explain why you can't prepare the links behind each edit link when you build the table?
shankumars replied on at Permalink Reply
great thanks @juliandale and @Johnthefish

I got solution by using the querystring and from your valuable suggestion. thanks to both




regards

Kumar
cjramki replied on at Permalink Reply
cjramki
Thanks @juliandale, @john and @shankumars,

This discussion was very useful to me...

CJ Ramki...;-)