Wednesday, December 16, 2009

Safari THead Issue

I'm not sure if this is an actual issue.

I'm using a .css file, and styling a table.

I'm using the tag thead.

I had two rows in thead.

I wanted to sort the table by column.

On sorting asc, make the border-top-style have a solid 1px #color.
On sorting desc, make the border-bottom-style solid 1px #color.

When you have two rows in thead, and sorting the first column on the second row,

Safari will give a border to the entire second row.

SOLUTION:

Remove the first row from head.

Monday, December 14, 2009

CSS change children with JQuery

I wanted to be able to change the children's css of an element with JQuery.

In a table, for instance, I wanted to change the data rows as the user's mouse and . I was using
$("#tr").mouseleave(function(){
$(this).children().css = "...";
});

This even changed rows that were header rows.

I had more than one table on the page, so accessing an id isn't efficient or practical.

I created a class in css, tableHead, and set the rows containing the th to this class.

Then in JQuery, after $(this).children().css = "";

$(".tableHead").children().css = "..";

This changed everything with the class "tableHead" to the new css.

MySQL Including Null values in a Query

I wanted to query a database for a table that references other tables.

(a -> b) ; (a -> c)

Some of the references from a -> b are null. I wanted to include the maches for a.id = 'id' anyway.

The key is to create a table in the SELECT segment of the query.

SELECT
a.id
a.name
(SELECT b.name FROM b WHERE b.id = a.bRefId) AS NullRefCol,
a.otherCol
FROM
a
WHERE
a.status = 'active'

This query will return all 'a's that have a status that is 'active' even if the reference to 'b' is null.

Tuesday, December 8, 2009

Great JQuery Websites

Collection of JQuery Tutorials

http://technosiastic.wordpress.com/2009/09/24/collection-of-top-jquery-tutorials-tips-tricks-techniques-to-improve-performance/

JQuery for Designers

http://jqueryfordesigners.com/

Wednesday, December 2, 2009

Finally, answers to how Controllers know about variables on a View

So, it's taken a while, but I've finally figured out how views variables and controllers work, with AJAX.

Ok,

For a controller method to see the value of a tag on a view, you must create a "<[percent]=HTML" tag. You can't just create a regular html tag, you must use the MVC ASP.NET helper.

It Must be in the AJAX form that you are submitting. It cannot be outside the form or the method will not see it.

They method sees the NAME you give the helper tag, NOT the id. So you can have multiple tags with the same name. This is helpful when you want to ajax a lot of functionality but need to keep the same tags but change the values, like knowing which view the user is currently on.

On Complete for AJAX happens when the form is finished submitting, NOT when it finishes loading.

Dec 7, 2009 - It, also, appears that initializing a Html.Hidden(...) field with a @value=".." will not be sent to the server. In other words, if you give @value="..." in the html attributes, the "..." will not be seen on the server. I've found that you must change the value in javascript.

Hope this helps.

Tuesday, December 1, 2009

Common IE bugs for Web Developers

Thanks Tuts+ -> nettuts

http://net.tutsplus.com/tutorials/html-css-techniques/9-most-common-ie-bugs-and-how-to-fix-them/