我有结构的商店:
Ext.create('Ext.data.Store', {
fields: [
'title'
],
data: [{
title: 'ABC'
}, {
title: 'ABC2'
}, {
title: 'ABC3'
}, {
title: 'ABC4'
}, {
title: 'ABC5'
}, {
title: 'ABC6'
}]
});
Run Code Online (Sandbox Code Playgroud)
因此,当我加载此商店列表时,将填充所有6条记录.
我只想按下按钮过滤这个商店我只是想从这个6记录中获得一些选定的记录可以.
提供一些想法或工作代码.
目前该rowediting插件提供了选项update/cancel.当我按下cancel按钮时,如果它是新添加的行,我希望它不添加新行.
我怎样才能做到这一点?
这是FIDDLE.
目前,有了rowediting,我只是添加和删除行.如果无法使用cancel,如何添加新按钮close并使其不添加行.
我也在查看sencha论坛,我找到了一个POST,其中说明如下:
fireEvent canceledit
如果autoRecoverOnCancel是真的,如果记录是幻影然后删除它
但是,这也行不通.你能建议吗?
var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false,
});
tbar: [{
text: 'Add Employee',
iconCls: 'employee-add',
handler: function() {
rowEditing.cancelEdit();
// Create a model instance
var r = Ext.create('Employee', {
name: 'New Guy',
email: 'new@sencha-test.com',
start: new Date(),
salary: 50000,
active: true
});
store.insert(0, r);
rowEditing.startEdit(0, 0);
}
}, {
itemId: 'removeEmployee', …Run Code Online (Sandbox Code Playgroud) 我是ExtJs的新手,想要将使用Sencha CMD创建的ExtJs 5应用程序集成到WebAPI应用程序中!
我进行了BUILD模式的集成,但没有进行开发模式.
关于这篇文章 ,整合步骤如下所示!
步骤1.创建路径:C:\ VCProject\SVCodeCampWeb\WebAPI
步骤2.在步骤1的目录中创建名为"API_NAME"的WebAPI项目.
步骤3.将ExtJS 5框架(ext-5.0.0)移动到步骤1的目录.
步骤4.使用sencha cmd生成extjs应用程序:
C:\VCProject\SVCodeCampWeb\WebAPI\ext-5.0.0>sencha generate app MyApp
C:\VCProject\SVCodeCampWeb\WebAPI\API_NAME\API_NAME\CMDBUG1
步骤5.通过Solution Explorer将ext应用程序包含在Web Api中.
步骤6.使用sencha cmd构建应用程序,如下所示:
C:\Users\albert\Documents\Visual Studio 2013\Projects\BMSIA\BMSIA.Web\BMSJS>sencha app build
作品!!!这些是我在WebAPI for BUILD模式的_Layout.chtml中包含的文件并且有效!
<script src="~/CMDBUG1/build/production/MyApp/app.js"></script>
<link href="~/CMDBUG1/build/production/MyApp/resources/MyApp-all.css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)
错误部分!!!
对于开发模式,我包括以下文件:
< link href="~/CMDBUG1/build/production/MyApp/resources/MyApp-all.css" rel="stylesheet" />
< script src="~/CMDBUG1/ext/ext-all.js"></script>
< script src="~/CMDBUG1/app.js"></script>
Run Code Online (Sandbox Code Playgroud)
但它抛出了这个错误:
TypeError: Ext.application is not a function
Run Code Online (Sandbox Code Playgroud)
如果您需要更多详细信息,请告诉我们!
任何帮助将不胜感激!
随着上周Sencha CMD和ExtJS 6.5的发布,我很高兴在我的ExtJS项目中使用ES6课程.与此说,"文件"的唯一排序我已经能够找到有关如何在ExtJS的实施ES6类会谈是这个职位从去年十月.虽然它给出了一个例子,但我认为我遗漏了一些东西,因为我在构建过程中遇到了以下错误.
[ERR] C2001: Closure Compiler Error (Character '@' (U+0040) is not a valid identifier start char) -- path/to/project/Foo.js:4
[ERR] C2001: Closure Compiler Error (primary expression expected) -- path/to/projectFoo.js:4:7
Run Code Online (Sandbox Code Playgroud)
Foo.js
import { define } from 'extjs-kernel'; // module names not final
import { Observable } from 'extjs-core';
import { Base } from 'app-some';
@define({
mixins: Observable,
config: {
value: null
}
})
export default class Foo extends Base {
updateValue (value, oldValue) {
this.fireEvent('valuechange', value, oldValue);
} …Run Code Online (Sandbox Code Playgroud) 所以我对此真的Vue.js很陌生,我想要实现的目标很简单,我正在尝试将此Ajax请求的结果附加到我的列表中
<div id="app">
<button v-on:click="buttonClick">Test</button>
<ul id="example-1">
<li v-for="t in test">
{{ t }}
</li>
</ul>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
'message': 'hello world',
'test': null
},
methods: {
buttonClick: function() {
axios.get('api/getdata')
.then(function(response) {
test = response.data;
//if this was Jquery I'd use $('li').append here
})
.catch(function(error) {
});
}
}
})
</script>
Run Code Online (Sandbox Code Playgroud)
现在的问题是我不知道该怎么做,我的变量test应该保存所有数据,然后我应该像我一样循环它,但是一旦我得到数据,我如何再次触发它?
编辑:澄清一下,我不是在问关于“this”和“self”的问题,我问的是如何将这些数据附加到一些 HTML 元素上
我正在创建一个 HTML 文档对象:
let newHTMLDocument = document.implementation.createHTMLDocument();
let html = `<!DOCTYPE html>
<html>
<head>
<title>Hello, world!</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>`;
newHTMLDocument.open();
newHTMLDocument.write( html );
newHTMLDocument.close();
console.log( String(newHTMLDocument) ); // [object HTMLDocument]Run Code Online (Sandbox Code Playgroud)
如何将 newHTMLDocument 转换为包含所有 HTML 代码(包括 doctype 和 html 标记)的字符串,而不是“[object HTMLDocument]”?
按钮
我想让它与像这样的事件侦听器一起使用:
document.body.addEventListener('click', function(e) {
console.log(e.target);
if (e.target.hasAttribute('data-a-target="popout-chat-button"')) {
console.log('popout button');
}
});Run Code Online (Sandbox Code Playgroud)
<button data-a-target="popout-chat-button" data-test-selector="popout-button">Popout</button>Run Code Online (Sandbox Code Playgroud)
我无法使用 hasAttribute 检查值,最好的方法是什么。
我正在使用excel-bootstrap-table-filter jQuery插件来对我网站上的表进行排序.除了排序日期字段外,它的工作方式与梦想类似.我有DD MMM YYYY格式的日期.
excel-bootstrap-table-filter根据DD值对表进行排序.任何人都知道如何让插件正确排序日期?
我有一个带有一些数据的网格(用户列表).对于每一行,我有许多操作,例如更新,删除,激活,暂停,查看您为其命名的订单.
我没有放置那么多的按钮来填充多个400-500像素,而是放置一个组合框,并将动作应用于每个字段.
问题是我不能简单地在列行中渲染一个组合框,或者我错过了什么?有人可以对此有所了解吗?
new Ext.grid.GridPanel({
region: 'center',
id: 'usersGrid',
store: store,
stripeRows: true,
autoExpandColumn: 'username',
columns: [{
// username
},{
// email
},{
// last seen
},{
// actions combo, it won't show
header: '',
width: 220,
fixed: true,
hideable: false,
dataIndex: 'actions',
renderer: new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
id: 0,
fields: ['abbr', 'action'],
data: [
['suspend', 'Suspend'],
['activate', 'Activate'],
['update', 'Update'],
['delete', 'Delete']
]
}),
displayField: 'action',
valueField: 'abbr',
mode: 'local',
typeAhead: false,
triggerAction: 'all',
lazyRender: true, …Run Code Online (Sandbox Code Playgroud) 如何<table>在Sencha Touch 2中的Panel上生成常规html ?
每行的数据可以来自商店.它不像List那样非常"移动",但我想在我的平板电脑应用程序上有一些细节面板包含以下几个部分:
header #1 <table> <tr><td>one</td>td>two</td></tr> <tr><td>foo</td>td>bar</td></tr> </table> header #2 <table> <tr><td>abc</td>td>xyz</td></tr> <tr><td>cat</td>td>dog</td></tr> </table>
基本的Panel定义应如下所示:
Ext.define('Kitchensink.view.HtmlTable', {
extend: 'Ext.tab.Panel',
config: {
activeItem: 1,
tabBar: {
docked: 'top',
layout: {
pack: 'center'
}
},
items: [{
title: 'Tab 1',
items: [{
html: '<h2 class="section">Section #1</h2>'
}, {
html: '<table class="style1">'
}],
}, {
title: 'Tab 2', …Run Code Online (Sandbox Code Playgroud)