473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to edit the text value inside the grid

kaleeswaran
132 100+
hi!
i have problem in the grid.i can't edit the values inside the grid.i have a edit image inside the grid.i planed to like when i click the edit image in the grid then the respective row will be displayed in the outside of the dynamic text box..i can display the dynamic text box...i struggled in will display the values in the grid...
give me some solution.....
thanks,
kaleeswaran
Dec 13 '07 #1
2 1610
acoder
16,027 Expert Mod 8TB
Post the code you've got so far.
Dec 13 '07 #2
rnd me
427 Expert 256MB
here is something like what you mention, perhaps it can be of use...


[PHP]<table>
<tr> <td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
</tr><tr>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
</tr><tr>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
</tr></table>

<br />

<textarea id="ta1" rows="15" cols="60" ></textarea>

<script>

var ray=[[]]; //the array to store table changes

// some support code
function el(tid) { return document.getElementById(tid);}
function tags(elm){ var o=[], i=0, r=document.getElementsByTagName(elm), mx=r.length; for(var z=0;z<mx ;z++) {o[z]=r[z]} ; return o; }
function getParent(elm, tagname) { tops:for (var z = 0; z < 99; z++) {var t = elm.parentNode ? elm.parentNode : elm.parentElement ? elm.parentElement : elm;if (!t.tagName) {return elm;}if (!tagname) {return t;}if (tagname==(tagname * -1 )) {if (z == tagname) {return t;}elm = t;continue tops;}if (t.tagName.toLowerCase().match(tagname.toLowerCase ())) {return t;}elm = t;}}



//custom code below
for(var z=0, mx=tags("tr").length; z<mx;z++){ ray[z]=[]; } //init array by length of table row (writing a col to an undefined row cause error!)

for(var z=0,tg=tags("input"), mx=tg.length; z<mx;z++){ //updrage all the text inputs to modify the array
var t=tg[z];
t.value=0;
t.size=4;
t.setAttribute("onchange","doRay(this)");
}//next text input

function doRay(t){ //modify the array with the value of the cell
var col=getParent(t, "td").cellIndex ||0;
var row=getParent(t, "tr" ).rowIndex || 0;
ray[row][col]=t.value;
el("ta1").value=ray.join("\n");
}//end function doRay update

</script>[/PHP]
Dec 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ronald S. Cook | last post by:
Hi all, I have an ASP.NET DataGrid wherein there is an edit link for each row. Upon clicking the link, certan fields in that row display in text boxes so that they may be edited. I would like...
0
by: Steve Bishop | last post by:
I have a form with a search text box and a grid that displays the results. Within the grid, I have edit command links set up to response.redirect to another page that puts the DataKey value in the...
2
by: keithb | last post by:
I have dropdown list in a gridview column edit template. It works OK, except when I edit a row, the dropdown list does not initialize to the existing value that shows in the textbox that displays...
0
by: bh | last post by:
I'm trying to edit data in a datagrid through a dropdown list with different id/text values. The problem comes in when I click the edit button & nothing appears to be happening. Did I do...
1
by: cyningeston | last post by:
OS: WinXP Pro, VB/ASP/ADO.NET I'm building a web-based supplier management application. For each supplier we are required by the FDA to track certain documents. I've managed to pull them from...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
6
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
1
by: John Wright | last post by:
I have a datagridview control that I have added 5 columns to. I bind the datagrid to a datatable that I get from another function. Once of the rows returned from the function is an empty field...
1
by: rogerford | last post by:
I have a grid which i bind with values from Database. I have events to edit and update the grid. I am not using SqlDatasource to connect to DB. Rather i am doing the updating of the grid...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.