yui

Y.Lang.isUndefined vs typeof undefined, which is better and why?

為{幸葍}努か 提交于 2020-01-14 22:55:11
问题 I was wondering why YUI libs use Y.Lang.isUndefined() even when JS has a built in feature to check type of a variable. 回答1: The reason that method exists is for API consistency -- the YUI team felt it would be weird to leave it out. As LightStyle points out, isUndefined() doesn't do anything special, so you probably shouldn't use it unless you really like the aesthetics. In fact, only a few of the YUI type checking methods do any actual useful work beyond what you could do natively. Ryan

YUI3 selector problem in ie8

别等时光非礼了梦想. 提交于 2020-01-13 17:59:29
问题 Y.one('form fieldset:nth-child(2)').toggleClass('hide'); in chrome, FF, opera this line works but in ie6-8 it throws an error 'Y.one(...)' is null or not an object. where is the problem? 回答1: Have to add the "selector-css3" module to your .use() statement if you want to use CSS3 selectors in browsers that don't support them natively. 来源: https://stackoverflow.com/questions/3713263/yui3-selector-problem-in-ie8

How to use YAHOO.util.Connect.asyncRequest and return results?

痞子三分冷 提交于 2020-01-13 11:08:39
问题 I'm using YAHOO.util.Connect.asyncRequest to get data from database, here is the code : function getCountArticle(contentCurValue) { var handleSuccess = function (res) { var countPubmed = YAHOO.lang.JSON.parse(res.responseText); var contentCountPubmed = countPubmed.totalArticleRecords; alert(contentCountPubmed); //return 15 for example }; var handleFailure = function () { alert("Error connecting data : Bad pubmed query"); }; var callback = { success:handleSuccess, failure:handleFailure,

How to use YAHOO.util.Connect.asyncRequest and return results?

匆匆过客 提交于 2020-01-13 11:08:09
问题 I'm using YAHOO.util.Connect.asyncRequest to get data from database, here is the code : function getCountArticle(contentCurValue) { var handleSuccess = function (res) { var countPubmed = YAHOO.lang.JSON.parse(res.responseText); var contentCountPubmed = countPubmed.totalArticleRecords; alert(contentCountPubmed); //return 15 for example }; var handleFailure = function () { alert("Error connecting data : Bad pubmed query"); }; var callback = { success:handleSuccess, failure:handleFailure,

YUI Autocomplete renders under other page elements in IE7

给你一囗甜甜゛ 提交于 2020-01-12 10:54:08
问题 I'm working now on a page that has a column of boxes styled with sexy shadows and corners and whatnot using the example here. I have to admit, I don't fully understand how that CSS works, but it looks great. Inside the topmost box is a text-type input used for searching. That search box is wired up to a YUI autocomplete widget. Everything works fine in Firefox3 on Mac, FF2 on Windows, Safari on Mac. In IE7 on WinXP, the autocomplete suggestions render underneath the round-cornered boxes,

YUI Datatable - Get ID of DOM Element after page has loaded and use it in other YUI events

怎甘沉沦 提交于 2020-01-06 08:51:52
问题 Okay so I have a YUI Datatable. Most of it is exactly as the how to guide says to construct it. I have an event that governs changing the rows per page. It's linked to the rows per page drop down element and it saves the value of that drop down as a cookie when the drop down is changed. var onRPPChange1 = YAHOO.util.Event.addListener("yui-pg0-1-rpp24", "change", getRPP_1); The problem is that "yui-pg0-1-rpp24" (the ID of the drop down) changes whenever I make updates to my data table. I would

How can I dynamically add rows and columns to a YUI dataTable

回眸只為那壹抹淺笑 提交于 2020-01-06 08:46:06
问题 I am trying to modify the the YUI sortable dataTable example to add rows and columns dynamically after the dataTable is created. My code looks like this: YUI().use("datatable-sort", function(Y) { var cols = [ {key:"Company", label:"Click to Sort Column A", sortable:true}, {key:"Phone", label:"Not Sortable Column B"}, {key:"Contact", label:"Click to Sort Column C", sortable:true} ], data = [ {Company:"Company Bee", Phone:"415-555-1234", Contact:"Sally Spencer"}, {Company:"Acme Company", Phone:

Why did touch events on my YUI slider suddenly stop working?

故事扮演 提交于 2020-01-05 10:08:16
问题 I had a site using YUI 3 sliders that was working fine for ages. About two weeks ago I was showing a friend my site on my phone, and it worked great. Then, about a week ago, I was showing it to another friend using my phone again, and the thumbs on the slider would not move. Something has changed and they no longer respond to touch events on my phone. On a computer, when using a mouse, the thumb is draggable. Everything works perfectly. It's only on devices where the interface requires touch

How do I post a javascript variable to an ASP.net MVC Model?

最后都变了- 提交于 2020-01-04 10:42:06
问题 Im trying to use the Yahoo rich text editor in my web application. I'm kind of new to web programming so this may be a silly question. I'm using a custom model called "blogpost". It contains the following properties: Title Body DateCreated Author I want to use the custom editor for only the "body" property. When I click submit it will build the other properties of the model from simple textboxes. I have placed the following code withing my input form code. <div class="yui-skin-sam"> <textarea

How do I post a javascript variable to an ASP.net MVC Model?

折月煮酒 提交于 2020-01-04 10:40:12
问题 Im trying to use the Yahoo rich text editor in my web application. I'm kind of new to web programming so this may be a silly question. I'm using a custom model called "blogpost". It contains the following properties: Title Body DateCreated Author I want to use the custom editor for only the "body" property. When I click submit it will build the other properties of the model from simple textboxes. I have placed the following code withing my input form code. <div class="yui-skin-sam"> <textarea