我想使用下面的fieldContainer是我的代码..
Ext.onReady(function () {
Ext.QuickTips.init();
var myViewport = new Ext.Viewport({
layout: 'border',
border: false,
renderTo: Ext.getBody(),
items: [{
region: 'north',
xtype: 'panel',
id: 'north-panel',
border: false,
height: 125
}, {
region: 'center',
xtype: 'panel',
id: 'center-panel',
border: false,
items: [{
xtype: 'fieldcontainer',
fieldLabel: 'Time worked',
combineErrors: false,
layout: 'hbox',
defaults: {
flex: 1,
hideLabel: true
},
items: [{
name: 'hours',
xtype: 'textfield',
width: 48,
allowBlank: false
}, {
name: 'minutes',
xtype: 'button',
width: 10,
text: 'add'
}]
}]
}]
}); …Run Code Online (Sandbox Code Playgroud) 我正在使用一个网格面板,我需要在其中创建一个列作为链接(它应该看起来像链接 - 没有动作).我正在使用网格面板中的监听器,并点击一个单元格,它的工作正常.唯一的事情是第1列应该看起来像一个链接.但是如何把href ="#"我不确定.这是我的代码:
var addressDetailsStore = Ext.create('Ext.data.Store', {
id:'addressDetailsStore',
autoLoad: true,
fields:
[
'addressType',
'street1',
'street2',
'province',
'city',
'country'
],
proxy: {
type: 'ajax',
url: 'resources/json/addressDetails.json', // url that will load data with respect to start and limit params
reader: {
type: 'json',
root: 'items',
}
}
});
Ext.define('iOMS.view.common.addressView', {
extend: 'Ext.grid.Panel',
alias: 'widget.AddressViewPanel',
layout: 'fit',
collapsible: true,
title:'Address',
store: addressDetailsStore,
listeners:{
cellclick:function (iView, iCellEl, iColIdx, iRecord, iRowEl, iRowIdx, iEvent){
// Getting the event and I am doing logic …Run Code Online (Sandbox Code Playgroud) 我知道如何创建一个浏览和选择文件的表单,这不是我的问题.我需要的是获取所选文件的内容,将其发送到服务器并进行处理.现在我只能获取文件位置.
我认为如果我在客户端(extjs)获取文件然后将其发送到服务器会更好,但我不知道如何做到这一点.
{
xtype: 'fileuploadfield',
hideLabel: true,
emptyText: 'Select a file to upload...',
id: 'upfile',
//name:'file',
width: 220
},
buttons:
[
{
text: 'Upload',
handler: function () {
obj.Import(Ext.getCmp('upfile').getValue())
}
}
]
Run Code Online (Sandbox Code Playgroud)
Import(...)是我的服务器功能.我需要给它的文件不仅仅是它的路径!!
提前谢谢您的时间
我将以下viewconfig应用于网格面板.它应该根据数据值更改行颜色,但更改在视图上不可见.
.changed_colour {
background-color: #FFCC00
}
viewConfig: {
//Return CSS class to apply to rows depending upon data values
getRowClass: function (row, index) {
var data = row.data;
return data.NoteType === 'PRIVATE' ? 'changed_colour' : '';
}
}
Run Code Online (Sandbox Code Playgroud)
我注意到Firebug中行的样式:
<tr class="x-grid-row changed_colour">
.x-grid-row .x-grid-cell {
background-color: white;
border-color: #FAFAFA #EDEDED #EDEDED;
border-right: 0 solid #EDEDED;
border-style: solid;
border-width: 1px 0;
font: 11px tahoma,arial,verdana,sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
上面的样式片段属于Extjs.任何人都可以建议解决这个问题吗?
谢谢
这个主题已在网上多次讨论,但所有主题都没有帮助我解决我的问题.我的javascript代码接收JSON嵌套数据.所有JSON数据1级数据都在网格面板中转录,但所有子数据都没有.我尝试了很多方法,但不可能.这就是我要求你帮助我的原因.
我的JSON:
{
"success":true,
"error":false,
"redirectUrl":null,
"fund":[{
"cat_id":1,
"catname":"Europe OE Japan Large-Cap Equity",
"region":{
"region_id":2,
"region_name":"JAPAN"
}
},{
"cat_id":2,
"catname":"Europe OE Europe Large-Cap Growth Equity",
"region":{
"region_id":1,
"region_name":"EUROPE"
}
}]
}
Run Code Online (Sandbox Code Playgroud)
我的型号:
var Recommended = new function() {
this.DataModel = function() {
Ext.define('Fund', {
extend: 'Ext.data.Model',
fields: [{
name: 'catname',
type: 'string'
},{
name: 'cat_id',
type: 'int'
}],
proxy :{
type: 'rest',
url: application +'directory/function',
reader: {
type: 'json',
root: 'fund'
}
},
associations: [{
type: 'hasOne',
model: 'Region',
primaryKey: …Run Code Online (Sandbox Code Playgroud) 如果我使TreePanel可折叠,工具图标会上下双箭头.
在手风琴中,他们切换到+/-.
我如何使用双箭头作为手风琴?
(4.1.1版)
我的表格上有组合框的问题.问题是当我加载表单数据时(有form.loadRecord),有时组合框是空的,即使我知道模型有数据.
当我查看Firebug时,我可以看到在加载记录后加载了组合框存储.我认为这就是原因 - 组合框存储器稍后加载然后加载记录.
这是我设置combobox商店的方式:
//All stores have autoload:true configuration.
var possessionGroundsStore = Ext.create('path.to.store');
var vehicleTypesStore = Ext.create('path.to.store');
var usePurposesStore = Ext.create('path.to.store');
this.editView = Ext.create('path.to.view');
this.editView.getPossessionGroundsField().store = possessionGroundsStore;
this.editView.getVehicleTypeIdComboBox().store = vehicleTypesStore;
this.editView.getUsePurposeField().store = usePurposesStore;
//later
this.editView.loadRecord(record);
Run Code Online (Sandbox Code Playgroud)
有没有一种解决这个问题的常用方法?
我现在能看到的唯一方法是store.load在每个组合框存储中使用回调,然后在加载所有存储后执行loadRecord,但这看起来很复杂.
有帮助吗?
更新:
何时form.loadRecord调用内部调用field.setValue().所以,重点是:在setValue调用之前必须填充组合框存储.如果未加载商店,您将看到valueField而不是displayField.
我在哪里将用户特定(会话)信息存储在ExtJS MVC应用程序中?
定义一个自定义基本控制器是否正确,该控制器可以包含具有用户特定信息的对象并在应用程序中使用它?
例:
Ext.define("MyApp.controller.BaseController", {
extend: "Ext.app.Controller",
session: Ext.create("MyApp.lib.UserSession"),
init: function() {
var me = this;
me.session.init();
/** some code **/
},
doSomething: function() {
var me = this;
var counter = me.session.get("counter");
}
});
Run Code Online (Sandbox Code Playgroud) 问题很简单.我有一个主屏幕,北区必须显示两个文本字段和一个按钮,以便用户连接.
我有这个代码.
Ext.create('Ext.container.Viewport', {
layout: 'anchor',
id: 'homescreen',
items: [
{
layout: 'border',
border: false,
height: 160,
anchor: '100%',
items: [
{
region: 'west',
// some codes here
},
{
xtype: 'container',
width: '70%',
region: 'east',
layout:
{
type: 'table',
columns: 1,
tdAttrs:
{
style: 'padding: 5px 15px 5px 15px;',
align: 'middle',
},
defaults:
{
width: 150,
textAlign: 'right'
},
},
items: [
{
xtype: 'textfield',
//fieldLabel: 'login',
labelWidth:50,
emptyText: 'Utilisateur',
margin: '18 0 0 0',
},
{
xtype: 'textfield', …Run Code Online (Sandbox Code Playgroud) 我正在开发一个EXTJS应用程序,我在EXTJS网格中显示数据.
每行都有一个编辑按钮.请检查图像.
我想点击编辑链接,将打开一个弹出窗口,其中包含所有可编辑字段,我可以从那里编辑行.
请帮助我实现这一目标.

这是我的代码.
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'assets/images/edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('ID'));
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢