Fixed Header with select list in header

Fixed Header with select list in header

morphmorph Posts: 1Questions: 0Answers: 0
edited December 2012 in FixedHeader
OK, so I have narrowed my issue down to the Fixed Header. I have been using the dataTables control for a while now and have found it to be superb for my sites - I've got it to do just about everything I have needed but this has me stumped! I have stripped everything back to the simplest terms for testing and you can see that version here:
http://www.the-morph.co.uk/test/TrainingComps2.aspx

- It loads with the Fixed Header OFF.
- Make a selection from the drop down in the header.
- Make a selection from the drop down in row 1.
- Click 'Check Selections' and see what you have chosen - all is correct.

- Now click the checkbox to turn ON the Fixed Header.
- Make a selection from the drop down in the header.
- Make a selection from the drop down in row 1.
- Click 'Check Selections' and see what you have chosen
- The selection from Row 1 is always correct but the header selection is ALWAYS 1 instead of what you chose - huh?!

- Turn OFF the Fixed Header and all works as expected.

Any ideas would be really helpful, thank you.

Replies

  • pejohnstpejohnst Posts: 3Questions: 0Answers: 0
    I am having a similar problem with ASP.NET controls (ImageButtons) in a FixedHeader header row. I believe it is a general issue with ASP.NET server control postbacks not being handled, probably because the visible controls in the header are cloned copies of the originals. At the moment, I have not been able to get this to work, which means I will not be able to use the FixedHeader extension. Other than this problem, it works great. I would really like to find a solution so I can use it. Have you had any luck?
  • pejohnstpejohnst Posts: 3Questions: 0Answers: 0
    I think you're out of luck (unless someone can correct me). I found a way I can work around my issue because I only need button events to fire and don't need to collect control values. The main issue I found is that the cloned elements are being added to the body outside of the form element. Therefore, those elements (and any values they contain) will not be part of the data submitted with the form (and button elements do not even cause a postback). I changed the line in _fnCloneTable from:
    document.body.appendChild(nDiv);
    to
    document.forms[0].appendChild(nDiv);

    That allows my button events to fire just fine, but you will run into issues if you try to use control values because you will now have multiple controls with the same ID. In that case, ASP.NET concatenates control values with a comma separator (for string values like TextBox.Text - not sure about all other properties).

    Sorry I can't provide a solution, but hope this information helps. Good luck!
This discussion has been closed.