Tag Archives: JQuery

SlickGrid Autocomplete

I’ve been working with SlickGrid on a project recently and it has been fun to work with.  It isn’t the best documented setup, but after a while I have figured out how to work with it on most levels giving me exactly what I want to work with.  One of the things my users asked for is a Autocomplete function.  I found a Stackoverflow question giving me the hint I needed in order to make this work.  The only problem was the autocomplete example provided was using a static list.  I wanted to have it build the list from that columns existing values and show a list, just like you get in Excel.  So here is the init function where I set this up.

Read More

SMF Package Manager Generator

Hello,
Originally I had wrote my original SMF Package Manager Generator a few years ago. It was sloppy coding, poor JavaScript and relied heavily on the server. Not my absolute best work, but was something I was proud on at the time from my efforts to dive into JavaScripting.

However, todays times are different. So with JQuery out there, I decided to take breaks from my projects for a couple hours for a few days and put forth a effort to rewrite this. Needless to say, I had the initial code wrote in only a few hours. My original script took me a few days alone. That didn’t count the package-info creator I made later which also took a while.

The new script attempts to rely all on JavaScripting via JQuery. It was a fun experience to build it this way. Although, because of JavaScript’s security measures, I couldn’t leave downloading the file outside of the server. So alas, I still have to process the actual download via the server. There is a work around with using Data URIs, however it didn’t provide the filename and sounds a bit flaky when the length of the url gets to be a bit long. I included both as a option though.

Oh and Its on github, because I see no reason to not share the code. Including the code I used to integrate it into my WordPress blog.

Read More

JQuery Week Calendar mouseover events

While working with a plugin for JQuery for week calendars. I came across a very annoying little bug. Using mouseover/out events did not seem to work correctly when hovering over the title and time. It just wouldn’t do what it should of.

Well after debugging and messing around for a while, I was able to figure out how to resolve this issue. In jquery.weekcalendar.js open up the file and locate:

After that code we want to add:

A little further down the file is:

We want to add after that:

This makes it work as I excepted it to. My thoughts here are that the inner divs are removing the mouseover events. So by attaching an event to them as well, it makes it work as well.

As a good GitHub person does, I submitted a pull request with these fixes in hopes that it gets merged into the plugin.

Read More

JQuery week calendar reoccurring events

JQuery has a nice plugin called . Very simple to use and I was able to integrate it into the database to handle pulling scheduling data. However I came across one issue. Reoccurring events.

Well after scrambling the web, I came to the conclusion that it wasn’t possible in the code by default. So away into the code I went. To say the least, my solution is nowhere near perfect nor does it allow for reoccurring events yet from different weeks or months. It was decided to take another course of action rather than trying to hack reoccurring events into the code. I just wanted to post what I had so far:

In jquery.weekcalendar.js we have this code:

Now before this and the block of code before it, I added in:

This lets me do reoccurring events for the current week. I am sure it could be greatly improved and somebody may be able to make it support multiple weeks.

In case anybody else wondered, this simply just needs a json array in the data of the weekday numbers (0-6). The key is recurring.

Read More

jQuery getting value of select with mulitple values

I have been dipping into learning jQuery. Very powerful and useful. But as I am just learning it, I am taking a learning curve to figure it out. Today I came across the need to get the values of a select that had multiple values. I needed to take the name attribute from the option as it contained a filename that I was going to use to display the image. Further more I wanted to separate those images based on their dimensions.

After some thankless google searches, I came up with code that accomplishes this task easily.

As for the HTML, I have my select box with multiple=”multiple” in it. Each option has a value attribute that I use for the database and a name attribute containing the filename. They also contain the friendly name. I then have 3 divs setup like so:

The loader lets me simply get the image loading, once it has the height and width of the image it moves it to the correct box. I keep the loader div hidden so there is no moving around showing as it does its work. Does the job for what I need it to do. Which is a simple previewer of the images being selected. I need the bigger ones to be separate as these are usually tower based images and would make a ugly looking layout otherwise.

Read More

Highslide for Wordpress Plugin