Form reset can not be reset ComboGrid
Call form1.getForm () reset ();. When found, if there is ComboGrid original value, the form can not be reset to reset ComboGrid
Tried: clear (); removeAll (); setValue (null); have no effect
Measures: ComboGrid.setValue ( ""); Success
if (reValue == undefined) {}
found out is determined, and finally check the data use typeof
method:
IF (typeof (revalue) == "undefined") {}
typeof returns a string, there are six possible: "number", "string", "boolean", "object", "function", "undefined"
E XTJS manual control textarea wrap
js used \ n tag, the format
var result = 'code:'+code+'\nmessage:'+message+'\nstatus:'+status+'';
Ext.getCmp('stock_result').setValue(result);
\ N after the variable and does not require a space, so that the wrap can maintain its
E XTJS highly adaptive TextArea
grow:true
E XTJS time format formatted
var date = Ext.Date.format(new Date(),"Y-m-d H:i:s");
E XTJS dynamic ExtJS Form controls set the color of the text displayed
Ext.getCmp('simpletxt').setFieldStyle('color:red');
E method XTJS panel trigger rendered completed Render
xtype: 'panel',
plugins: 'responsive',
layout: 'fit',
region: 'south',
listeners: {render: function() {}}
E XTJS html content update
Ext.getCmp('stockEoBarcode_result').update("<iframe width=900px height=900px id='myframe'name='myframe' src='jsBarcode.ftl?code="+lpnCodes+"' frameborder=0 border=0 marginwidth=0 marginheight=0 allowtransparency='yes'></iframe>");
E XTJS form.Panel the Load event
formGrid.getForm().load({
url : ...,
headers : {"access_token": access_token},
method : 'POST',
async:false,
params : {warehouseId: "3432cdb5"},
success : function (form,action) {
formGrid.getForm().setValues({
mitQty:action.result.object.totalMitQty,
})
},
failure: function (form,action) {
}
});
E XTJS asynchronous request method Ajax.request
Ext.Ajax.request({
url : ...,
defaultHeaders : {"access_token": access_token},
params : {warehouseId: "3432cdb5"},
datatype: 'JSON',
method: 'POST',
success : function(response) {
console.log(response);
var json = JSON.parse(response.responseText);
Ext.getCmp('totalQty').setValue(json.object.totalQty + " 箱");
},
failure: function (response, options) {
console.log(response);
}
});
E XTJS the TextArea has been separated by commas, remove the last comma
var arr = lpnCode.split("\n");
var lpnCodes = "";
for (var i = 0; i < arr.length; i++) {
// 这里将每一行继续按逗号拆分:split(/[符号1、符号2]/)
lpnCodes = lpnCodes + arr[i] + ",";
}
lpnCodes = lpnCodes.substring(0,lpnCodes.length-1);
E XTJS determines the beginning or end to XX
var str = "XY,"
str.endsWith(",") --返回true
str.startsWith("X") --返回true
E XTJS add a text box icon
{
xtype : 'textfield',
columnWidth : 0.2,
name : 'goodsName',
fieldLabel : '商品名称',
emptyText : '请输入...',
triggers : {
bar : {
cls : Ext.baseCSSPrefix+ 'form-clear-trigger',
handler : function() {this.reset();}
}
}
}