+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: jQuery help on first plugin

  1. #1
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default jQuery help on first plugin

    Hello

    Attached is my first attemt at a simple timetable plugin. The problem I am having is with the jQuery I want to use to sexify the filtering.

    This plugin is specifically for a client at the moment (I may open source it after), and as such is written with a specific design goal in mind. This is why it is important that each set of days is only labelled once. For example, if three classes take place on a monday, then the first is labelled monday with the 'day' field in the others blank until we get to tuesdays classes.

    The problem I have i when you start to hide certain sections (i.e show only 'ballet' classes). If you hide the first monday class, then you lose the monday label. How can I use jQuery to ensure that each group of days is labelled properly.

    The plugin is bult to be degradable, and the PHP side of things seem to work fine, but the client wants JS magic!!

    Many thanks.
    Attached Files

  2. #2
    Ryan's Avatar
    Ryan is online now WPTavern Forum Moderator
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,418

    Default

    You might have more luck with answers if you cut your code down to the bare minimum. At the moment everyone needs to read through your 8.8 kB of plugin to code to figure out what is going on. A live example page might help a lot, that way people can see what is going on instead of having to figure it out from the code.

  3. #3
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default

    http://fitzgraham.netne.net/wordpress/timetable/

    Here's the link, test by selecting 'ballet' from the pull down, and notice that the 'mon' cell disappears (quite rightly), I need to figure out how to dynamically move it!!

  4. #4
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default

    One method I am thinking of it to create tables within tables, but seems a little hacky. The idea would be to have a 2 column table, one column the day of the week, the other would contain a table containing all the other rows. What do you think?

  5. #5
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default

    Okay, so the aforementioned method has worked.

    Now my problem is when the jQuery hides ALL the classes from a single day, how can I get that day to hide properly?

  6. #6
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default

    Okay, I get the feeling I'm talking to myself a little, but hey, if I keep posting where I am, maybe it'll jog someone soon enough.

    I'm pretty sure the easiest way to do what I am talking about is by using class names on rows that have none of a certain class type. i.e, if there are no ballet classes on a wednesday then giving the wednesday row a class of 'no-ballet' which the jQuery can hide easily.

    I did think of doing this with a second foreach loop, but that doesn't appear to want to play. Can you only do that once on a set of results? Would I have to call the mySQL twice?

  7. #7
    Ryan's Avatar
    Ryan is online now WPTavern Forum Moderator
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,418

    Default

    I'm not surprised no one has replied. Rifling through extraneous code trying to find the important bits is very time consuming. If you aren't going to bother posting a cut-down minimalist version of your problem I wouldn't reply. I know next to nothing javascript so couldn't answer it anyway, but if even if I could, I wouldn't.

  8. #8
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default

    Sorry, didn't mean to offend. It wasn't an attack, more just pointing out that too much coffee and stress has led me to ramble to myself in an internet forum.

    I did post a live example. But my problem now is a logical one, the code is without error, it is just missing key functionality.

    On my iPhone in bed now, will post snippets in the morning. It shouldn't matter that your JS isn't great, as I have that nailed. I just need to create a loop that defines the aforementioned class names. Too late to get my head around it now.

  9. #9
    Ryan's Avatar
    Ryan is online now WPTavern Forum Moderator
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,418

    Default

    I'm not offended in the slightest. Just letting you know why I think no one has responded.

  10. #10
    Mild Fuzz is offline Here For The Peanuts
    Join Date
    Feb 2010
    Posts
    103

    Default

    Quote Originally Posted by Ryan View Post
    I'm not offended in the slightest. Just letting you know why I think no one has responded.
    good. :)

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts