javascript-framework

How to replace a component in ExtJS

我的梦境 提交于 2019-12-06 03:53:51
I have an ExtJS window, with a toolbar at the top, and loads with plain Panel at the bottom with plain HTML. This works fine. On a button click, I'd like to be able to replace the bottom panel (called content), with another panel. If tried this var clickHandler = function(calendar){ // 'content' is the panel id // calendar is also an Ext.Panel object Ext.getCmp('content').update(calendar); }; What am I missing? Update replaces HTML content. You want to remove the old panel and add the new. Try .remove()ing the old panel and .add()ing the new one, and don't forget .doLayout(). 来源: https:/

JavaScript based iPhone UI framework

删除回忆录丶 提交于 2019-12-06 02:17:16
问题 We have a push based web-application. Recently, we planned to make an iPhone app for it. Much like Facebook has it's iPhone application as well as web presence. We are looking for a UI framework that can get us going quickly. I've leafed through PhoneGap and couple other JS based UI frameworks mentioned here. I am bit unsure what can suit us the best. So, I am looking for your suggestions. Our constraints are as follows: The framework should be JS based. We all are web-devs and want to avoid

Is it possible to use Aurelia in a non-spa application?

巧了我就是萌 提交于 2019-12-05 17:33:15
Recently I've been playing around with different frameworks and libraries, looking for something that really suits my needs. You see, my job mainly involves creating asp.net mvc applications and for most of them using Razor and a little bit of jQuery is enough. But in certain cases and only for a few pages,which are rarely more than one or two per app, I really need something extra that helps me avoid getting entangled in a bunch of jQuery code. As I mentioned, I tried a couple of alternatives and from them, the one I liked the most is Aurelia, because of its simplicity and the fact that it

VueJS Custom Props Validation Function

此生再无相见时 提交于 2019-12-05 17:08:47
I'm new to VueJS, so I've been following their official guide . I'm able to trigger the first 5 properties validator, but I can't seem to be able to trigger the last example (custom validation function). my JS file: Vue.component('propValidation', { props: { // basic type check (`null` means accept any type) propA: Number, // multiple possible types propB: String, // a required string propC: { type: String, required: true }, // a number with default value propD: { type: Number, default: 100 }, // object/array defaults should be returned from a // factory function propE: { type: Object, default

Unit testing watchers in angular js controller

北城以北 提交于 2019-12-05 16:55:39
How can this snippet code be unit tested using jasmine ? $scope.profileObject = ProfilesSharedObject; $scope.$watch("profileObject.startDate", function() { var startDate = $scope.profileObject.startDate._d; var endDate = $scope.profileObject.endDate._d; var newStartDate = moment(startDate).format("YYYY-MM-DD"); var newEndDate = moment(endDate).format("YYYY-MM-DD"); $scope.startDate = moment(startDate).format("MM/DD"); $scope.endDate = moment(endDate).format("MM/DD/YYYY"); $scope.getSleepData(newStartDate, newEndDate); }); where ProfileSharedObject is a angular js service Watch listeners are

Explain this confusing dojo tutorial syntax for declare

梦想的初衷 提交于 2019-12-05 11:42:27
I am reading the syntax for using dojo's declare for class creation. The description is confusing: The declare function is defined in the dojo/_base/declare module. declare accepts three arguments: className, superClass, and properties. ClassName The className argument represents the name of the class, including the namespace, to be created. Named classes are placed within the global scope. The className can also represent the inheritance chain via the namespace. Named Class // Create a new class named "mynamespace.MyClass" declare("mynamespace.MyClass", null, { // Custom properties and

Extjs grid column header, add dropdown menu item to specific columns

拟墨画扇 提交于 2019-12-05 10:02:56
I'm trying to add a button to the column header drop-down menus in my grid. However, I only want to add it to columns with certain itemId. So far I've got it working to add the button to all columns, see code below. I dont see where I could check each column's itemId though, it doesn't seem to iterate through the columns. Is there any workaround for this? Thank you! items:[{ region:'center', xtype:'grid', columns:{ items: COLUMNS, //defined in index.php }, store:'Items', selType: 'checkboxmodel', listeners: { afterrender: function() { var menu = Ext.ComponentQuery.query('grid')[0].headerCt

Phonegap Error - “Cannot read property 'capture' of undefined” on Android

允我心安 提交于 2019-12-05 08:40:24
Trying to create a starter app with PhoneGap. I'm stuck on this line: navigator.device.capture.captureAudio(onSuccess, onError, {limits:1, duration:5}); It works fine on iOS but throws this error on Android emulator: Cannot read property 'capture' of undefined Here's navigator object, at the time of error (notice there's no device property which is causing this error) { "language": "en-US", "product": "Gecko", "mimeTypes": { "length": 0 }, "appVersion": "5.0 (Linux; U; Android 4.0.3; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", "plugins": {

Sencha touch 2 + Apple push notifications + Ext.device.Push

烂漫一生 提交于 2019-12-05 03:50:28
问题 I recently started developing with Sencha Touch 2, at the moment i'm creating an app that needs support for Apple Push Notifications. So I've created the neccesary certificates at the Apple developer center and used them to package the application with the Sencha Touch SDK tools. All went well and I'm able to run this app on my device. In the app I added a button to receive the device token. When I tap the button it executes the following code: Ext.device.Push.register({ type: Ext.device.Push

Use Javascript frameworks without build tools like grunt and gulp? [closed]

元气小坏坏 提交于 2019-12-04 22:24:44
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I'm trying out some modern Javascript frameworks like Angular, React, Vue and Ember, and they all want me to use build tools like npm , grunt , gulp , maven , etc. Web-programming used to be fun. Just change some files, refresh the browser and see if it works. Now every time I