473,385 Members | 1,736 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,385 software developers and data experts.

Javascript Q: Dynamically Add Table Row and Locking Columns

1
Hi,

This is my first post on this forum. Hello everyone!

I am developing a .Net web app in C# and I am using javascript pretty extensively (to provide a richer experience).

My server code data binds and creates a <table id="tblA"....> with rows of data. tblA is contained inside of a <div id="divA"....> whose Style.Overflow is set to scroll. I am freezing the first column of the table so that users can scroll right/left and still see this info.

When the page is built by the server, the first column of each row will sucessfully freeze.

When rows are dynamically added (on the client), the first columns do not freeze.

The code (on the client) to add the rows is the same as that on the server. Below is the style for the first column for every row:

style="LEFT:expression(document.getElementById('di vA').scrollLeft); POSITION:relative"

My guess is that "divA" doesn't know that it needs to notify the LEFT attribute of the newly added rows when they are added dynamically.

I greatly appreciated any help. I have been working on this all day and are hundreds of hairs shy of what I started with this morning.

Thanks,
Mark
May 17 '06 #1
1 7755
acoder
16,027 Expert Mod 8TB
This is an example solution. There are others too. The advantage is that they are cross-browser and don't depend on an IE-only CSS trick.
Apr 23 '08 #2

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

Similar topics

0
by: LU | last post by:
I have code to dynamically add more text boxes when the user clicks the 'add another carrier' button. Problem is it creates the text boxes within the same table row as previously created boxes. ...
6
by: Jon | last post by:
Hello, I have a datagrid and the data in it is dynamically created at runtime... For iCounter = 0 To dataset.Tables(0).Columns.Count - 1 Dim objbc As New BoundColumn() With objbc .DataField...
6
by: KKramsch | last post by:
OK, here's the scenario: I have a CGI script that generates a page with frames (BTW, I'm not crazy about frames, but in this case the decision to use them is out of my hands). In a typical...
3
by: rn5a | last post by:
A SqlDataReader is populated with the records from a SQL Server 2005 DB table. The records retrieved depends upon 2 conditions (the conditions depend on what a user selects in an ASPX page). If...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
3
by: Rambaldi | last post by:
Although i'm working on ASP.net, i think the problem i'm facing is related to my javascript function so i hope i create the thread in the right section. My goal is to create a table dynamically,...
3
chathura86
by: chathura86 | last post by:
hi i wrote the following code to populate a table dynamically it works perfectly on Firefox but not in IE 7 does not show any errors on IE7 either please help me
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.