components

Componetizing jQuery functions calls. Best practices?

别来无恙 提交于 2019-12-06 10:17:29
I'm building a site that is going to consist of components. A component defined as a particular set of HTML and CSS and jQuery. Each page of the site will consist of many components. Per best practices, we're putting our javascript block at the bottom of the page. We load the needed .js files, and then I'm planning on calling the functions needed: doThisThing(); doThatThing(); Let's say I have Component X. I want to call a function whenever that component appears on the rendered page. From a jQuery perspective, what would be the ideal way to handle this? Some options: 1) Always call the

Get number of components in placeholder, Sitecore

眉间皱痕 提交于 2019-12-06 10:01:39
问题 I have a component that needs to know how many components thats currently added to the very same placeholder, this since it needs to update a value of an html-attribute based on its index within the placeholder. Is there anyway to get either the number of components thats already added to a placeholder, or to get the current-renderers index? Usually I would just use a simple for-loop and set the attribute, but since its a placeholder with components thats not an option. Thanks in advance! 回答1

.NET component in DELPHI 2009

别等时光非礼了梦想. 提交于 2019-12-06 09:59:08
问题 Could you please tell me if .NET component can be used with Delphi 2009 and, if so, could you please send me some example code. Thanks in advance. 回答1: Not in delphi for Win32. You can use Delphi PRISM for this. You can also check CrossTalk or Hydra 回答2: There are several ways of doing it and traditional COM/Interop is just one way to do it. Another way is to use the already existing infrastructure that is built into the CLR to support COM/Interop and mixed-mode C++/CLI. The CLR has excellent

Angular 2 dynamic component click event

落花浮王杯 提交于 2019-12-06 09:46:36
I'm trying to create components dynamically but i want to add a click action to it and i don't know how. I was trying to do this: constructor(public navCtrl: NavController, private resolver: ComponentFactoryResolver) { this.lastSelectedResource = this.defaultImage; } public createNew() { this.container.detach(0); } ngAfterContentInit() { let widgetFactory = this.resolver.resolveComponentFactory(CreateComponent); let widgetReference = this.container.createComponent(widgetFactory); widgetReference.instance.click = this.createNew; } but isn't the way do that. Anybody knows how? Günter Zöchbauer

Using Laravel 4's Input class outside the framework

房东的猫 提交于 2019-12-06 09:02:18
问题 I like the way Laravel 4 handles the input, and how you can get the value via Input::get() no matter if its sent by get, post or whatever. I'm working on a project that does not use Laravel as the framework, but it will be great if i can use the Input class. Can anyone help me how can this be done? 回答1: Input is, in fact, the Request class. You can require it using Composer: composer require "illuminate/http" "4.x" Require Composer autoload.php in your project: require 'vendor/autoload.php';

ReactJS - how create two or more components in same page

扶醉桌前 提交于 2019-12-06 08:39:56
I'm new user of ReactJS and I bumped in a point. I'm creating a generic map component, it works perfectly. However, only can render one component by page. I would like to instead use getElementById , I could use getElementsByClassName . Is it possible? I would like to leave my system generic, where I use many components in same page. In the example, I use to render 1 map, but if I want to use with 2 or more maps? <div class="MyMap" comp-url="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3538.7513696363594"></div> <div class="MyMap" comp-url="https://www.google.com/maps/embed?pb=!1m18

ExtJS4 LinkButton Component

元气小坏坏 提交于 2019-12-06 07:42:18
问题 I'm trying to create my own LinkButton component in Ext JS 4. Nothing new, right? My code looks like this: Ext.define('LinkButton', { extend: 'Ext.Component', xtype: 'linkbutton', autoEl: 'a', renderTpl: '<a href=\"javascript:;\">{text}</a>', config: { text: '', handler: function () { } }, initComponent: function () { var me = this; me.callParent(arguments); this.renderData = { text: this.getText() }; var handler = me.getHandler(); if (handler) { me.on('click', handler); } } }); So far so

Difference between a Component and a View in Aurelia (and their lifecycles)

拈花ヽ惹草 提交于 2019-12-06 07:02:00
问题 Could you please tell me what is difference between a component and a View in Aurelia? What are their architectures and What is the difference between their lifecycles? 回答1: As a rule of thumb, the difference between a view and a component in Aurelia can be summarised as: A view in Aurelia is simply put the .html and the styling that comes with it (.scss/.less/.css) A view-model in Aurelia is the code behind it (.js/.ts class) A component is the combination between a view and view-model, and

Russell Libby's Pipes components

断了今生、忘了曾经 提交于 2019-12-06 06:30:43
Does anyone know where I could download Russell Libby's named pipes components? All the links I can find point to http://home.roadrunner.com/~rllibby/source.html Which is no longer alive. HMcG I have found the TPipeServer and TPipeClient source code here . Looks like the original Russell Libby's code. Here's the version I have on my system. I tried posting it directly in this comment but it is too long. This source code should work on Delphi 6 and up (including Delphi 2009, 2010, and XE). I posted it here . For detailed directions on how to generally turn this source file into a design-time

OverrideComponent with TestBed

こ雲淡風輕ζ 提交于 2019-12-06 05:47:33
问题 I have MainComponent that uses ChildComponentA as a @ViewChild . MainComponent is calling a method on ChildComponentA . I want to write an unit test case mocking ChildComponentA . How can I do this using TestBed (in Angular 2 RC5)? Before I used to use overrideDirective(MainComponentName, ChildComponentA, MockChildComponentA); Is there an equivalent to this using TestBed ? I tried using TestBed.overrideComponent(ChildComponentA,{ set: { template: '<div></div>' } }); which just sets the