alloy-ui

Add class when scroll down with AlloyUI

只愿长相守 提交于 2020-01-17 11:35:21
问题 I need to add a class when the user scroll down. I usually do this with jQuery : $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 10) { $(".dockbar").addClass("dockbar-opacity"); } }); How can I do the same thing with AlloyUI ? Really thanks. 回答1: Using the ScrollInfo plugin and its scroll event var body = Y.one('body'); body.plug(Y.Plugin.ScrollInfo); body.scrollInfo.on('scroll', function (e) { if (e.scrollTop >= 10){ Y.one('.dockbar').addClass('dockbar-opacity

Add class when scroll down with AlloyUI

眉间皱痕 提交于 2020-01-17 11:35:08
问题 I need to add a class when the user scroll down. I usually do this with jQuery : $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 10) { $(".dockbar").addClass("dockbar-opacity"); } }); How can I do the same thing with AlloyUI ? Really thanks. 回答1: Using the ScrollInfo plugin and its scroll event var body = Y.one('body'); body.plug(Y.Plugin.ScrollInfo); body.scrollInfo.on('scroll', function (e) { if (e.scrollTop >= 10){ Y.one('.dockbar').addClass('dockbar-opacity

How can I create a AlloyUI DiagramBuilder from the JSON returned by DiagramBuilder.toJSON()?

谁都会走 提交于 2020-01-16 04:12:08
问题 DiagramBuilder.toJSON() returns a JSON representation of the diagram. How can I use this JSON object to create a new DiagramBuilder with the same diagram? 回答1: You can pass the jsonData.nodes to the fields attribute of the DiagramBuilder : var diagramBuilderJSON = diagramBuilder.toJSON(); new A.DiagramBuilder({ fields : diagramBuilderJSON.nodes }).render(); 回答2: You can pass the result of DiagramBuilder.toJSON() to the fields parameter of the DiagramBuilder. See the example below. jsonData =

How can I add a customized buttons to the AlloyUI Scheduler's event popup?

廉价感情. 提交于 2020-01-13 11:24:10
问题 How can I add a customized buttons to the AlloyUI Scheduler's event popup? The event popup includes Save , Cancel , and Delete buttons, but I would like to add another one (for example Edit ). I've looked through the Schedulers API Doc, but I cannot find any information on adding buttons to the event popup. 回答1: The SchedulerEventRecorder class contains a reference to the popover which contains the form to which you are seeking to add buttons. However, I've tried to customize the toolbar

How to localize the alloyui scheduler component?

蓝咒 提交于 2020-01-11 10:22:08
问题 I am trying to fully localize the alloyui scheduler in French. Following this article: How can I get a localized version of a YUI 3 or AlloyUI component? the job is almost done. However I am still missing tips for two things: - I need the time format in the left column to be changed from 1-12am/pm to 1-24 - I don't succeed to localize the "All day" term in the left top corner (or at least a way to hide it). Any help will be welcome 回答1: To change to a 24 hour clock, you need to set the

how to capture the data sent by alloy ui io request in serveresource method?

柔情痞子 提交于 2020-01-03 00:19:08
问题 Getting blank values for title and description in serveResource method.Is this the right way to send the parameters from io request? After inserting blank values in database I have to reload the page to see the inserted values?So io-request is not ajax request? <aui:script use="aui-base"> A.one('#<portlet:namespace/>save').on('click', function(event) { var A = AUI(); var title=A.one('#<portlet:namespace/>title').val(); alert(title); var description=A.one('#<portlet:namespace/>description');

Save, Edit, Delete, and Cancel events in AlloyUI Scheduler

佐手、 提交于 2020-01-01 17:14:46
问题 How can I listen for the Save, Edit, Delete, and Cancel events from AlloyUI's Scheduler? I need to save the value in our database for future use, but I don't see any documentation for this. The current code that I have is this: YUI().use('aui-scheduler', function(Y) { var items = [ { content: 'Wake Early' }, { content: 'Exercise' }, ]; var schedulerViews = [ new Y.SchedulerWeekView(), new Y.SchedulerDayView(), new Y.SchedulerMonthView(), new Y.SchedulerAgendaView() ]; var eventRecorder = new

Add custom node to Alloyui DiagramBuilder in JAVA

浪子不回头ぞ 提交于 2019-12-24 13:57:06
问题 I have been using this example to make a diagram with Alloyui, but I don't find the way to make a custom node in JAVA . I've tried to simply add it in AvaliableFields, but doesn't seem to work: diagramBuilder.setAvailableFields( new NodeType( "diagram-node-custom-icon", "Custom", "custom" )); I have already done this in another example, directly in the javascript and works: Y.DiagramNodeCustom = Y.Component.create({ NAME: 'diagram-node', ATTRS: { type: { value: 'custom' }, myAtt: { validator:

Bootstrap modal in Liferay

删除回忆录丶 提交于 2019-12-22 08:03:29
问题 I use Bootstrap 2.3.2 and Liferay 6.2 bundled with Tomcat. I have some modal windows with complex body structure created in Bootstrap 2.3.2 and I would like to use them in my portal. Here is said that Liferay uses Bootstrap 2.3.2 css, but not Bootstrap 2.3.2 javascript and components like modals, tooltips, tabs, ... are included in AlloyUI. I included Bootstrap 2.3.2 javascript and tried to use my modal windows, but if I want to show a modal window it doesn't appear. I would like to ask, how

How to add custom nodes and properties to AlloyUI diagram builder

放肆的年华 提交于 2019-12-17 20:49:41
问题 I have been trying to use diagram builder example of AlloyUI. I need to add some extra custom node types as well as some additional properties for the nodes. I thought about modifying and then building the library but it sounds like an overkill for such a task and also I have had issues with building. Is there an easy way to do this? UPDATE I realized I could directly modify files in build folder to get rid of build process. I tried adding something like: var Lang = A.Lang, .. CUSTOM =