Click here to Skip to main content
15,888,610 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: RequireJs Pin
ujjwal shukla16-Apr-14 22:36
ujjwal shukla16-Apr-14 22:36 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 22:41
professionalSuraj Sahoo | Coding Passion16-Apr-14 22:41 
GeneralRe: RequireJs Pin
Sibeesh KV24-Sep-14 18:31
professionalSibeesh KV24-Sep-14 18:31 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion24-Sep-14 19:28
professionalSuraj Sahoo | Coding Passion24-Sep-14 19:28 
GeneralRe: RequireJs Pin
Sibeesh KV24-Sep-14 21:00
professionalSibeesh KV24-Sep-14 21:00 
AnswerRe: RequireJs Pin
thatraja16-Apr-14 21:32
professionalthatraja16-Apr-14 21:32 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 21:36
professionalSuraj Sahoo | Coding Passion16-Apr-14 21:36 
QuestionGridview fixed header and footer while scrolling Pin
harsha714-Apr-14 4:09
harsha714-Apr-14 4:09 
Hi ,

I workin on Gridview fixed header and footer while scrolling by using java script

<script language="javascript">
$(document).ready(function() {
try {
$(".divgrid").each(function() {
var grid = $(this).find("table")[0];
var ScrollHeight = $(this).height();
var gridWidth = $(this).width()-10;
var headerCellWidths = new Array();
// for (var i = 0; i < grid.getElementsByTagName('TH').length; i++) {
// headerCellWidths[i] = grid.getElementsByTagName('TH')[i].offsetWidth;
// }
grid.parentNode.appendChild(document.createElement('div'));
var parentDiv = grid.parentNode; var table = document.createElement('table');
for (i = 0; i < grid.attributes.length; i++) {
if (grid.attributes[i].specified && grid.attributes[i].name != 'id') {
table.setAttribute(grid.attributes[i].name, grid.attributes[i].value);
}
}


table.appendChild(document.createElement('tbody'));
table.getElementsByTagName('tbody')[0].appendChild(grid.getElementsByTagName('TR')[0]);
gridRow.getElementsByTagName('TD')[i].offsetWidth) {
}
var gridHeight = grid.offsetHeight;
if (gridHeight < ScrollHeight)
ScrollHeight = gridHeight;
parentDiv.removeChild(grid);
var dummyHeader = document.createElement('div');
dummyHeader.appendChild(table); parentDiv.appendChild(dummyHeader);
var scrollableDiv = document.createElement('div');
if (parseInt(gridHeight) > ScrollHeight) {
gridWidth = parseInt(gridWidth) + 17;
}
scrollableDiv.style.cssText = 'overflow:auto;height:' + ScrollHeight + 'px;width:' + gridWidth + 'px';

scrollableDiv.appendChild(grid);
parentDiv.appendChild(scrollableDiv);
});
}
catch (err) { }
}
);
</script>

&lt;div class="divgrid"&gt;
&lt;asp:GridView ID="gvEmployees" runat="server" ShowFooter="true"&gt;
&lt;FooterStyle BackColor="Green" /&gt;
&lt;/asp:GridView&gt;
&lt;/div&gt;


now problem is alignment header columns width and data columns width are different size.

Thanks & Regards
Harsha

-- modified 14-Apr-14 10:22am.
AnswerRe: Gridview fixed header and footer while scrolling Pin
Anurag Gandhi24-Apr-14 5:29
professionalAnurag Gandhi24-Apr-14 5:29 
AnswerRe: Gridview fixed header and footer while scrolling Pin
sankarsan parida12-May-14 7:23
professionalsankarsan parida12-May-14 7:23 
Questionselecation of image with user prefrence Pin
Member 107387389-Apr-14 23:01
Member 107387389-Apr-14 23:01 
AnswerRe: selecation of image with user prefrence Pin
Tom Marvolo Riddle10-Apr-14 2:55
professionalTom Marvolo Riddle10-Apr-14 2:55 
QuestionRe: selecation of image with user prefrence Pin
ZurdoDev11-Apr-14 6:59
professionalZurdoDev11-Apr-14 6:59 
QuestionPlease help me to transfer data between elements in a web form. Pin Pin
lersmethasakul9-Apr-14 13:10
lersmethasakul9-Apr-14 13:10 
AnswerRe: Please help me to transfer data between elements in a web form. Pin Pin
Richard MacCutchan9-Apr-14 23:32
mveRichard MacCutchan9-Apr-14 23:32 
QuestionRe: Please help me to transfer data between elements in a web form. Pin Pin
ZurdoDev10-Apr-14 1:52
professionalZurdoDev10-Apr-14 1:52 
QuestionDrag and drop database related items Pin
tinaclement9-Apr-14 3:04
tinaclement9-Apr-14 3:04 
AnswerRe: Drag and drop database related items Pin
ZurdoDev10-Apr-14 1:53
professionalZurdoDev10-Apr-14 1:53 
QuestionGet ID of Clicked Object in Iframe Using JQuery Pin
RebornProgrammer8-Apr-14 17:38
RebornProgrammer8-Apr-14 17:38 
SuggestionRe: Get ID of Clicked Object in Iframe Using JQuery Pin
ZurdoDev10-Apr-14 1:55
professionalZurdoDev10-Apr-14 1:55 
QuestionAdd a dynamic label to video selected Pin
wfzen8-Apr-14 10:29
wfzen8-Apr-14 10:29 
AnswerRe: Add a dynamic label to video selected Pin
jkirkerx9-Apr-14 9:29
professionaljkirkerx9-Apr-14 9:29 
GeneralRe: Add a dynamic label to video selected Pin
wfzen14-Apr-14 4:59
wfzen14-Apr-14 4:59 
Questionfocus() not working Pin
RabbitTrail6-Apr-14 17:27
RabbitTrail6-Apr-14 17:27 
AnswerRe: focus() not working Pin
Blikkies7-Apr-14 22:01
professionalBlikkies7-Apr-14 22:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.