User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,060 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,446 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1465 | Replies: 3 | Solved
Reply
Join Date: Jan 2005
Location: defiance, oh
Posts: 19
Reputation: sqlchopper is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
sqlchopper sqlchopper is offline Offline
Newbie Poster

Help How can I access the datagrid data with javascript.

  #1  
Jan 16th, 2008
Here is html
[code]
<asp:datagrid id="mrpDataGrid" style="Z-INDEX: 289; LEFT: 576px; POSITION: absolute; TOP: 512px" runat="server" Width="160px" Height="90px" autogeneratecolumns="False">
<AlternatingItemStyle BackColor="LightGray"></AlternatingItemStyle>
<Columns>
<asp:BoundColumn DataField="SCHEDULE_DT" HeaderText="Scheduled Date" DataFormatString="{0:d}"></asp:BoundColumn>
<asp:BoundColumn DataField="SCHEDULE_QTs" HeaderText="Summed Quantity"></asp:BoundColumn>
</Columns>
</asp:datagrid>
I need to get values of both bound columns to use in calculations.
TIA
javascript newbie
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,537
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 109
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: How can I access the datagrid data with javascript.

  #2  
Jan 17th, 2008
If the data are on the server computer, javascript can't see them, because javascript runs on the client computer.
Last edited by MidiMagic : Jan 17th, 2008 at 12:45 pm.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jan 2005
Location: defiance, oh
Posts: 19
Reputation: sqlchopper is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
sqlchopper sqlchopper is offline Offline
Newbie Poster

Re: How can I access the datagrid data with javascript.

  #3  
Jan 17th, 2008
the script i show puts out a aleart showing that there is 82 rows in the datagrid. i just have not been able to figure out how to get to the columns to retieve the data. i've tried navroot.rows(i). col[0], cells[0], several things and no luck.
Reply With Quote  
Join Date: Jan 2005
Location: defiance, oh
Posts: 19
Reputation: sqlchopper is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
sqlchopper sqlchopper is offline Offline
Newbie Poster

Solution Re: How can I access the datagrid data with javascript.

  #4  
Jan 22nd, 2008
 
<asp:table id="dmdTbl" style="Z-INDEX: 617; LEFT: 280px; POSITION: absolute; TOP: 552px" runat="server" Width="184px" Height="60px" >
 <asp:TableRow ID="drows" >
    <asp:TableCell ID="DmdDate" Enabled=False ></asp:TableCell>
    <asp:TableCell ID="Dqty" Enabled=False ></asp:TableCell>
 </asp:TableRow>
</asp:table>

code is this:
            var ord = 0;     // set up int
            var dd = new Date();   //set up date field
            //ord = document.getElementById('dmdTbl').rows.length;     // fid # of rows
            //alert("value "+ord);     //display number of rows
            var rowposi = document.getElementById('dmdTbl').rows;    // set position of row
            for (var i=0;i<document.getElementById('dmdTbl').rows.length;i++) {  
                 dd = rowposi[i].childNodes[0].innerText;
                 ord = rowposi[i].childNodes[1].innerText;
                 // ..... do something with dd and ord
                 //alert("value "+dd+"ord "+ord+"cnt "+i);   // show values
             }     // end for loop

I hope this help someone else.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 12:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC