Show/Hide Details Not Already in Table?

Show/Hide Details Not Already in Table?

samlsaml Posts: 8Questions: 0Answers: 0
edited August 2009 in General
Hello-

I'm working on this database:
http://masterloggercertification.com/cmswebsite/index.php?page=current-nemlc-companies-new-3

I would like the details window to contain other cells from the database, but when I added "phone", the place where it should be coming up is telling me that it is "undefined".

Could you please help clue me in to what I might be doing wrong?

Thanks,
sam

Replies

  • samlsaml Posts: 8Questions: 0Answers: 0
    Also, FYI, this is being processed server side.

    Thanks,
    sam
  • samlsaml Posts: 8Questions: 0Answers: 0
    edited August 2009
    One More Thing.

    Using Safari 4.0 the database does not load at all, just says "loading data from server"
    Works fine on Firefox 3.0.11 and in Safari 4.0.3

    Thanks,
    sam
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Sam,

    Regarding your original question, what to do is to have a hidden column with the extra information that you want to have available for the 'details'. You can then get this information in fnOpen() from fnGetData() and then do whatever it is that you want with it :-)

    Regarding the Safari issue - I don't have access to Safari 4.0 since I've upgraded to 4.0.3 already (unless you know of a way to install them side-by-side?) - but I'd be surprised if much has changed in this area. Is the console showing any Javascript errors or anything?

    Regards,
    Allan
  • samlsaml Posts: 8Questions: 0Answers: 0
    Hey Allan-

    I got the "details" data working, and when I did, it started working in safari 4.0 again... I must have been doing something wrong...
    http://masterloggercertification.com/cmswebsite/index.php?page=current-nemlc-companies-new-3

    One more question, if you don't mind.
    In the details field, is it possible to only show the text, and field from the database if there is info in the database?

    For instance, if I have:

    [code]sOut += 'Phone:'+aData[6]+' ';[/code]

    ... but there is no data for that row, can I have it display nothing at all, and move the next line up.

    Please let me know if you need more clarification.

    Thanks,
    sam
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Sam,

    I'm not quite sure what you mean by the no data for the row (it would probably be obvious if the table was working - but it doesn't appear to be at the moment - see below). If there is no data, can you not just no output that row?

    btw - it looks like you might have an error in your JSON return at the moment. http://jsonlint.com is a great site for debugging that kind of thing.

    Regards,
    Allan
  • samlsaml Posts: 8Questions: 0Answers: 0
    Hi Alan-

    Sorry about that, I was working on the page, and had made a mistake in the programming.
    It is not complete, but up and running.
    You can see what I mean now.
    For instance, if there is no fax number for the company listed in the page below, can I remove the whole row, including the HTML generated text, and move the rest of the data up?

    http://masterloggercertification.com/cmswebsite/index.php?page=current-nemlc-companies-new-3

    Thanks again,
    sam
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Sam,

    Can you just do something like this:

    [code]
    if ( aData[6] != "" )
    {
    sOut += 'Phone:'+aData[6]+' ';
    }
    [/code]
    That will not output the phone row, if there is no phone data - or have I missed the point?

    Regards,
    Allan
  • samlsaml Posts: 8Questions: 0Answers: 0
    Hi Allan-

    Thanks, that's exactly what I was looking for.
This discussion has been closed.