今天在问答中看到这样的问题,我这里给出简单的实现,没有后台,纯extjs代码实现component的titlechange问题
Ext.define('TitleChange', {
extend: 'Ext.data.Model',
fields: [
{name: 'title',mapping:'title'}
],
idProperty: 'titleChange'
});
Ext.onReady(function () {
var myData = [
{'title':"WindowTitileChange"}
];
var store = Ext.create('Ext.data.ArrayStore', {
model: 'TitleChange',
data: myData,
autoLoad: true
});
var win = Ext.create('Ext.window.Window', {
title: 'Hello',
height: 200,
width: 400
});
store.load({
callback : function(r, options, success) {
win.setTitle(store.getAt(0).data.title);
win.show();
}
});
});
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
<link rel="stylesheet" type="text/css" href="../../extjs-4.1.0/resources/css/ext-all.css" charset="UTF-8">
<script type="text/javascript" src="../../extjs-4.1.0/ext-all-debug.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body>
<div id="test" style="margin:10px;height:800px;"></div>
</body>
</html>
分享到:
相关推荐
as I have written in the title the files are used to change the size of button
color from red to green in the specified display state of the component part. This is not the overriding color level. 6. Closes, but does not save, the assembly document. 7. Opens the component's ...
Carbonomics-The future of energy in the age of climate change.pdf
比如有两个txt文件,要根据其中一个txt中的信息内容,去更改另一个txt文件中 的指定内容,也就是对字符串的操作。
The Component Object Model Specification Version 0.9 October 24, 1995 Note: This document is an early release of the final specification. It is meant to specify and accompany software that is still in...
Title The Future of Machine Intelligence: Perspectives from Leading Practitioners Author(s) David Beyer Publisher: O’Reilly Media Inc. (February 29, 2016) Book Description Advances in both theory ...
This will change the shape of a sample form to pre-selected shapes.
This demonstrates how to change the height of a combobox’s drop-down height using API.
We found suitable direction-change features of the imaginary strokes in the pen-up state for on-line handwritten cursive character recognition. Our method simultaneously uses both directional features...
As the computer industry changes from single-processor to multiprocessor architectures, this revolution requires a fundamental change in how programs are written. To leverage the performance and power...
(b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...
As the computer industry changes from single-processor to multiprocessor architectures, this revolution requires a fundamental change in how programs are written. To leverage the performance and power...
This component lists a list of TDBSum objects that include the type of operation (goSum or goCount), as well as the field name for displaying the calculation, and performs the corresponding request. ...
The breathtakingly rapid pace of change in computing makes it easy to overlook the pioneers who began it all. Written by Martin Davis, respected logician and researcher in the theory of computation, ...
Because many readers are familiar with the layout of the first edition, we have tried to change it as little as possible. Here is a summary of the main changes: 1On the Web, this quote has been ...
FRM 2020 Current Issues指定阅读材料。"The Impact of Blockchain Technology on Finance: A Catalyst for Change,” International Center for Monetary and Banking Studies, 2018.
As more and more connected devices generate data, we will need to solve the problem of how to collect, store, and make sense of IoT data by leveraging the power of database systems. The book begins ...
The authors have wisely chosen to stay away from describing the technology products that run the world's financial systems, since they change too fast anyway, but have stayed focused on the important...
Shows how to change the background color of an RTF box.