extjs: load mask grid - extjs

I am using extjs grid, and I have a jQuery timer, which will call RenderGrid function every 20 seconds. I want to show mask for grid each timer tick. Please advise.
function RenderGrid(dataObj) {
var jasonContent = JSON.parse(dataObj)
if (document.getElementById('panel').innerHTML != '') {
document.getElementById('panel').innerHTML = '';
}
var myData = {
records: jasonContent
};
var fields = [
{ name: 'Position_ID', mapping: 'Position_ID' },
{ name: 'PriorityCount', mapping: 'PriorityCount' },
{ name: 'MyCheckBox', mapping: 'MyCheckBox' },
{ name: 'Veh_Plateno', mapping: 'Veh_Plateno' },
{ name: 'Drv_Firstname', mapping: 'Drv_Firstname' },
{ name: 'GPSTimeAsString', mapping: 'GPSTimeAsString' },
{ name: 'Speed', mapping: 'Speed' },
{ name: 'SubFleet_Name', mapping: 'SubFleet_Name' }
];
var gridStore = new Ext.data.JsonStore({
fields: fields,
data: myData,
root: 'records'
});
var cols = [
{ id: 'Position_ID', header: "Position_ID", width: 160, sortable: true, dataIndex: 'Position_ID', hidden: true, hideable: false },
{ header: "", width: 30, sortable: false, dataIndex: 'MyCheckBox', renderer: renderCheckBox, hideable: false, menuDisabled: true },
{ header: "", width: 30, sortable: false, dataIndex: 'PriorityCount', renderer: renderIcon, hideable: false, menuDisabled: true },
{ header: "Veh_Plateno", width: 100, sortable: true, dataIndex: 'Veh_Plateno' },
{ header: "Drv_Firstname", width: 100, sortable: true, dataIndex: 'Drv_Firstname' },
{ header: "GPSTime", width: 100, sortable: true, dataIndex: 'GPSTimeAsString' },
{ header: "Speed", width: 100, sortable: true, dataIndex: 'Speed' },
{ header: "SubFleet_Name", width: 100, sortable: true, dataIndex: 'SubFleet_Name' }
];
gridStore.setDefaultSort('Veh_Plateno', 'asc');
var grid = new Ext.grid.GridPanel({
ddGroup: 'gridDDGroup',
store: gridStore,
renderTo: 'panel',
columns: cols,
enableDragDrop: true,
stripeRows: true,
pageSize:25,
header: false,
loadMask: true,
autoExpandColumn: 'Position_ID',
width: 900,
height: 325,
region: 'west',
title: 'Data Grid',
selModel: new Ext.grid.RowSelectionModel({ singleSelect: false }),
listeners: {
'rowdblclick': function (grid, rowIndex, e) {
var rec = grid.getStore().getAt(rowIndex);
var columnName = grid.getColumnModel().getDataIndex(2);
Ext.MessageBox.alert('', rec.get(columnName));
// do something
}
}
});
//grid.getEl().mask();
//grid.store.reload();
//grid.getEl().unmask();
//gridStore.load({ params: { start:0, limit: 25} });
/// grid.loadMask.show();
grid = null;
cols = null;
fields = null;
gridStore = null;
myData = null;
}
thaks man this approch working fine with me but now my browser is hanging it seems, grid object will enter in infinite loop this all my script code, please prvide me example with timer if you can :
var grid = null;
function RenderPositionsGrid(dataObj) {
var jasonContent = JSON.parse(dataObj)
var myData = {
records: jasonContent
};
if (grid == null) {
var fields = [
{ name: 'Position_ID', mapping: 'Position_ID' },
{ name: 'PriorityCount', mapping: 'PriorityCount' },
{ name: 'MyCheckBox', mapping: 'MyCheckBox' },
{ name: 'Veh_Plateno', mapping: 'Veh_Plateno' },
{ name: 'Drv_Firstname', mapping: 'Drv_Firstname' },
{ name: 'GPSTimeAsString', mapping: 'GPSTimeAsString' },
{ name: 'Speed', mapping: 'Speed' },
{ name: 'SubFleet_Name', mapping: 'SubFleet_Name' }
];
var gridStore = new Ext.data.JsonStore({
fields: fields,
data: myData,
root: 'records'
});
var cols = [
{ id: 'Position_ID', header: "Position_ID", width: 160, sortable: true, dataIndex: 'Position_ID', hidden: true, hideable: false },
{ header: "", width: 30, sortable: false, dataIndex: 'MyCheckBox', renderer: renderCheckBox, hideable: false, menuDisabled: true },
{ header: "", width: 30, sortable: false, dataIndex: 'PriorityCount', renderer: renderIcon, hideable: false, menuDisabled: true },
{ header: "Veh_Plateno", width: 100, sortable: true, dataIndex: 'Veh_Plateno' },
{ header: "Drv_Firstname", width: 100, sortable: true, dataIndex: 'Drv_Firstname' },
{ header: "GPSTime", width: 100, sortable: true, dataIndex: 'GPSTimeAsString' },
{ header: "Speed", width: 100, sortable: true, dataIndex: 'Speed' },
{ header: "SubFleet_Name", width: 100, sortable: true, dataIndex: 'SubFleet_Name' }
];
gridStore.setDefaultSort('Veh_Plateno', 'asc');
grid = new Ext.grid.GridPanel({
ddGroup: 'gridDDGroup',
store: gridStore,
renderTo: 'panel',
columns: cols,
enableDragDrop: true,
stripeRows: true,
pageSize: 25,
header: false,
loadMask: true,
autoExpandColumn: 'Position_ID',
width: 900,
height: 325,
region: 'west',
title: 'Data Grid',
selModel: new Ext.grid.RowSelectionModel({ singleSelect: false }),
listeners: {
'rowdblclick': function (grid, rowIndex, e) {
var rec = grid.getStore().getAt(rowIndex);
var columnName = grid.getColumnModel().getDataIndex(2);
Ext.MessageBox.alert('', rec.get(columnName));
// do something
}
}
});
}
else {
grid.store.loadData(myData);
}
}
function renderIcon(val) {
if (val) {
val = '../images/grid/icon_warning.png';
return "<img class=Blink src='" + val + "'>";
}
}
function renderCheckBox(val, cell, record) {
var x = '<input onclick="alert(' + cell.id + ')" type="checkbox" name="mycheckbox" />';
//var x = '<input type="checkbox" name="mycheckbox" />';
return x;
}
function renderDate(date) {
alert(date);
return date.format("d.m.Y");
}
function BindGridView() {
Data.GetVehiclePositions(onSuccess, onFail, null);
}
function onSuccess(result) {
RenderPositionsGrid(result);
var timeout = 4000; var timer;
timer = $.timer(timeout, function () { BindGridView(result); });
}
function onFail(result) {
alert("fail");
}
function blink() {
$('.Blink').delay(100).fadeTo(200, 0.5).delay(200).fadeTo(100, 1, blink);
}
Ext.onReady(function () {
BindGridView();
blink();
});

You could use
var myMask = new Ext.LoadMask(grid.getEl(), {msg:"Please wait..."});
myMask.show();
But I find your approach kind of weird, seems like the only thing changing every 20 seconds is your dada, your store, column model, grid never changed.
Can you just do a simple loadData(Object data, [Boolean append] ) in your timer handler? the API is here

Related

Disable tbar button based on grid data extjs 6.2

Conditionally i need to disable the toolbar button based on the grid json data, if status not "New"
tbarItems.push(
"->",
{
text: t('import'),
id: 'masterdata_import',
iconCls: 'pimcore_icon_import',
disabled: false,
scale: 'small',
handler: this.importJob.bind(this),
dataIndex: 'status',
renderer: function (value, rowIndex, record) {
if (value !== 'New') {
tbar.disable();
}
},
}
);
https://i.stack.imgur.com/8hVmN.png
Any idea how to do this?
Thanks
i made an example at sencha fiddle. Take a look:
https://fiddle.sencha.com/#view/editor&fiddle/2qs3
You can bind disabled parameter to parameter from viewModel, while viewModel can be updated e.g when data in store changed (event datachanged is fired).
getLayout: function () {
if (this.layout == null) {
var itemsPerPage = pimcore.helpers.grid.getDefaultPageSize(70);
this.store = pimcore.helpers.grid.buildDefaultStore(
'/admin/referenceapp/import/get-import-files?processed=0',
['date','time','sourceFileLocation','sizeReadable','status','jobReference'],
itemsPerPage,
{autoLoad: true}
);
// only when used in element context
if(this.inElementContext) {
var proxy = this.store.getProxy();
proxy.extraParams["folderDate"] = this.element.folderDate;
} else {
}
this.pagingtoolbar = pimcore.helpers.grid.buildDefaultPagingToolbar(this.store);
var tbarItems = [];
tbarItems.push(
"->",
{
text: t('import'),
id: 'masterdata_import',
iconCls: 'pimcore_icon_import',
//disabled: false,
scale: 'small',
bind: {
disabled: "{one_different_than_new}"
},
handler: this.importJob.bind(this)
}
);
var tbar = Ext.create('Ext.Toolbar', {
cls: 'main-toolbar',
items: tbarItems
});
var columns = [
{text: t("date"), sortable: true, dataIndex: 'date', flex: 100, filter: 'date'},
{text: t("time"), sortable: true, dataIndex: 'time', flex: 100, filter: 'string'},
{text: t("source_file_location"), sortable: true, dataIndex: 'sourceFileLocation', filter: 'string', flex: 200},
{text: t("size"), sortable: true, dataIndex: 'sizeReadable', filter: 'string', flex: 200},
{text: t("status"), sortable: true, dataIndex: 'status', filter: 'string', flex: 200},
{text: t("jobReference"), sortable: true, dataIndex: 'jobReference', filter: 'string', flex: 200},
];
columns.push({
xtype: 'actioncolumn',
menuText: t('delete'),
width: 40,
dataIndex: 'status',
renderer: function (value, rowIndex, record) {
if (value !== 'New') {
rowIndex.tdCls = 'importnotdelete'
}
},
disabled:false,
items: [{
tooltip: t('icon_delete_import'),
icon: "/bundles/pimcoreadmin/img/flat-color-icons/delete.svg",
handler: this.removeVersion.bind(this)
}]
});
var plugins = [];
this.grid = new Ext.grid.GridPanel({
frame: false,
title: t('plugin_referenceapp_masterdataname_importview'),
store: this.store,
region: "center",
columns: columns,
columnLines: true,
bbar: Ext.create('Ext.PagingToolbar', {
pageSize: 0,
store: this.store,
displayInfo: true,
limit:0
}),
tbar: tbar,
stripeRows: true,
autoScroll: true,
plugins: plugins,
viewConfig: {
forceFit: true
},
viewModel: {
data: {
"one_different_than_new": false
}
},
//listeners: {
// afterrender : function(model) {
// console.log(model.store.data.items);
//
// for(i = 0; i<model.store.data.items.length; i++){
//
// if (model.store.data.items[i].status !== 'New') {
// tbar.disable();
// //console.log('test');
// }
//
// else{
// //console.log('no new');
// }
// }
//
// }
//}
});
this.grid.on("rowclick", this.showDetail.bind(this));
this.detailView = new Ext.Panel({
region: "east",
minWidth: 350,
width: 350,
split: true,
layout: "fit"
});
var layoutConf = {
items: [this.grid, this.detailView],
layout: "border",
//closable: !this.inElementContext
};
if(!this.inElementContext) {
//layoutConf["title"] = t('product_versions');
}
this.layout = new Ext.Panel(layoutConf);
this.layout.on("activate", function () {
this.store.load();
var check = function () {
var isDifferentThanNew = false;
this.store.each(function (r) {
if (r.get('status') != 'New') {
isDifferentThanNew = true;
}
});
this.grid.getViewModel().set('one_different_than_new', isDifferentThanNew);
}
// Listen on datachanged and update
this.store.on('update', function (s) {
check();
});
this.store.on('datachanged', function (s) {
check();
});
check();
}.bind(this));
}
return this.layout;
},

extjs subtable checkcolumn click

I am very new to extjs, and I saw this excellent post:
dynamic url inside a extjs table dont work
I was wondering if there is a way to enable checkbox functionality on the subtable?
I tried making slight modifications to the sample, but I can't find a way to have the checkboxes clickable and capture the events associated with it.
Please see the modified code below. Is it possible to have a clickable checkbox inside a Subtable?
Thanks in advance!
// SALVAGUARDAS -- added Approved field
Ext.define('Salvaguardas', {
extend: 'Ext.data.Model',
fields: ['Approved', 'id_amenaza', 'tipo', 'modo', 'codigo', 'denominacion', 'eficiencia', ]
});
//SALVAGUARDAS
var salvaguardaStore = Ext.create('Ext.data.Store', {
model: 'Salvaguardas',
data: [
{Approved: true, id_amenaza: 1, tipo: 'Correctiva', modo: 'Correctiva', codigo: 'corr-01', denominacion: 'correctiva 1', eficiencia: 'MB' }
]
});
//GRIDPANEL
Ext.create('Ext.grid.Panel', {
renderTo: 'example-grid',
store: amenazaStore,
//width: 748,
//height: 598,
title: '<bean:write name="informesAGRForm" property="nombreActivo"/>',
plugins: [{
ptype: "subtable",
headerWidth: 24,
listeners: {
'rowdblclick': function(grid, rowIndex, columnIndex, e){
// Get the Record, this is the point at which rowIndex references a
// record's index in the grid's store.
var record = grid.getStore().getAt(rowIndex);
// Get field name
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var data = record.get(fieldName);
alert(data);
}
},
columns: [{
//text: 'Approved',
//dataIndex: 'Approved',
//hidden: true,
//width: 100
xtype: 'checkcolumn',
header: 'Approved',
dataIndex: 'Approved',
width: 85,
listeners: {
checkChange: function ()
{
console.log('checkChange');
}
}
}, {
text: 'id_amenaza',
dataIndex: 'id_amenaza',
hidden: true,
width: 100
}, {
width: 100,
text: 'id_salvaguarda',
dataIndex: 'id_salvaguarda'
},
{
text: 'denominacion',
dataIndex: 'denominacion',
width: 100
},{
text: 'descripcion',
dataIndex: 'descripcion',
width: 100
},{
text: 'eficacia',
dataIndex: 'eficacia',
width: 100
},
],
getAssociatedRecords: function (record) {
var result = Ext.Array.filter(
salvaguardaStore.data.items,
function (r) {
return r.get('id_amenaza') == record.get('id');
});
return result;
}
}],
listeners: {
rowdblclick: function (view, record, tr, columnIndex, e) {
console.log('rowdblclick');
var cell = e.getTarget('.x-grid-subtable-cell');
if (!cell) {
return;
}
var row = Ext.get(cell).up('tr');
var tbody = row.up('tbody');
var rowIdx = tbody.query('tr', true).indexOf(row.dom);
//var records = view.up('grid').getPlugin('subtable').getAssociatedRecords(record);
var records = view.up('grid').plugins[0].getAssociatedRecords(record);
var subRecord = records[rowIdx];
console.log('rowdblclick: ' + rowIdx + ' - ' + subRecord);
},
rowclick: function (view, record, tr, columnIndex, e) {
console.log('rowclick');
var cell = e.getTarget('.x-grid-subtable-cell');
if (!cell) {
return;
}
var row = Ext.get(cell).up('tr');
var tbody = row.up('tbody');
var rowIdx = tbody.query('tr', true).indexOf(row.dom);
//var records = view.up('grid').getPlugin('subtable').getAssociatedRecords(record);
var records = view.up('grid').plugins[0].getAssociatedRecords(record);
var subRecord = records[rowIdx];
console.log('rowclick: ' + rowIdx + ' - ' + subRecord);
}
},
collapsible: false,
animCollapse: false,
columns: [
{
text: 'ID',
hidden: true,
hideable: false,
dataIndex: 'id'
},
{
text: 'Codigo',
width: 50,
sortable: true,
hideable: false,
dataIndex: 'codigo'
},
{
text: 'Denominación',
width: 150,
dataIndex: 'denominacion',
},
{
text: ' Autenticidad',
flex: 1,
dataIndex: 'a_riesgo'
},
{
text: 'Confidencialidad',
flex: 1,
dataIndex: 'c_riesgo'
},
{
text: 'Integridad',
flex: 1,
dataIndex: 'i_riesgo'
},
{
text: 'Disponibilidad',
flex: 1,
dataIndex: 'd_riesgo'
},
{
text: 'Trazabilidad',
flex: 1,
dataIndex: 't_riesgo'
},
{
text: 'Total',
flex: 1,
dataIndex: 'total_riesgo'
}]
});

How does the ExtJS column grouping work in EditorGridPanel?

How does the 'ExtJS' column grouping work in 'EditorGridPanel'? For, in this example: 'http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/group-header-grid.html', it seems like it's not really working, yet its working fine for me in 'simple grid panel'.
Ext.apply(this,
{
store: new Ext.data.Store(
{
reader: new Ext.data.JsonReader(
{
id: '"ID"',
totalProperty: 'totalCount',
root: 'rows',
fields: [
{ name: 'ID', type: 'string' },
{ name: 'organizationID', type: 'string' },
{ name: 'StructureID', type: 'string' },
{ name: 'Type', type: 'string' },
{ name: 'PropID', type: 'string' },
{ name: 'ProtectedSurface', type: 'string' },
{ name: 'Content', type: 'string' },
{ name: 'CPType', type: 'string' },
{ name: 'Location', type: 'string' },
]
}),
proxy: new Ext.data.HttpProxy({ url: this.url }),
baseParams: { cmd: 'getData1', objName: this.objName, aad: Ext.getCmp('clientidforStr').getValue() },
sortInfo: { field: '"ID"', direction: 'ASC' },
remoteSort: true,
mode: 'local',
autoLoad: true,
listeners: {
load: {
scope: this, fn: function (store) {
// keep modified records accros paging
var modified = store.getModifiedRecords();
for (var i = 0; i < modified.length; i++) {
var r = store.getById(modified[i].id);
if (r) {
var changes = modified[i].getChanges();
for (p in changes) {
if (changes.hasOwnProperty(p)) {
r.set(p, changes[p]);
}
}
}
}
//alert(Ext.getCmp('areaidforStr').getValue());
}
},
exception: function (proxy, type, action, options, response, arg) {
if (response.responseText != '') {
Ext.Msg.alert('From getData Command', response.responseText);
}
//this.showError(response.responseText, 'from getData Command:');
//alert(response.responseText + '\n from getData Command ');
console.log(response);
if (type === 'remote') {
// success is false
// do your error handling here
alert('error' + response);
console.log(response); // the response object sent from the server
}
}
}
}),
features: [{
groupHeaderTpl: 'Subject: {Location}',
ftype: 'groupingsummary'
}],
columns: [
{
header: 'ID',
id: 'ID',
dataIndex: 'ID',
hidden: true,
hideable: false,
sortable: true,
editor: new Ext.form.TextField({ allowBlank: false })
},
{
header: 'Structure Group',
id: 'StructureID',
dataIndex: 'StructureID', editable: false,
width: 45,
sortable: true,
editor: comboStructureAreaRelation,
renderer: Ext.util.Format.comboRenderer(comboStructureAreaRelation, AssignedGridStoreforStr)
},
{
header: 'Structure',
dataIndex: 'Type',
id: 'Type', editable: false,
width: 45,
sortable: true,
editor: StructureTypeCombo,
renderer: Ext.util.Format.comboRenderer(StructureTypeCombo, StorestrructureType)
},
{
header: 'Asset ID',
dataIndex: 'PropID', editable: false,
id: 'PropID',
width: 60,
sortable: true,
editor: new Ext.form.TextField({ allowBlank: false, cls:'textStyle' })
},
{
header: 'Protected Surface',
dataIndex: 'ProtectedSurface',
id: 'ProtectedSurface',
editable: false,
width: 45,
sortable: true,
editor: ComboTankProtectedSurface,
renderer: Ext.util.Format.comboRenderer(ComboTankProtectedSurface, storeTankProtectedSurface)
},
{
header: 'DATA EX',
id: 'ProtectedSurface11',
columns: [
{
header: 'Asset ID',
dataIndex: 'PropID', editable: false,
id: 'PropID11',
width: 60,
sortable: true,
editor: new Ext.form.TextField({ allowBlank: false, cls: 'textStyle' })
},
{
header: 'Protected Surface',
dataIndex: 'ProtectedSurface',
id: 'ProtectedSurface11',
editable: false,
width: 45,
sortable: true,
editor: ComboTankProtectedSurface,
renderer: Ext.util.Format.comboRenderer(ComboTankProtectedSurface, storeTankProtectedSurface)
},
]
},
{
header: 'Content',
dataIndex: 'Content', editable: false,
id: 'Content',
width: 60,
sortable: true,
},
{
header: 'CP Type',
dataIndex: 'CPType', editable: false,
id: 'CPType',
width: 60,
sortable: true,
},
{
header: 'Location',
dataIndex: 'Location', editable: false,
id: 'Location',
width: 60,
sortable: true,
},

Concatenate in EditorGridPanel

Inside of my editorGridPanel, I have a three columns. I want to concatenate the data inside of my 'firstname' and 'lastname' column directly going to or when the cursor or focus are now in my 'email address' column in every row. Could someone help me about this problem?
var cm = new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [{
id: 'id',
header: 'ID',
dataIndex: 'id',
width: 220,
editable: false,
hidden: true
},
{
id: 'firstname',
header: 'First Name',
dataIndex: 'firstname',
width: 220,
editor: new fm.TextField({
allowBlank: false
}),
listeners: {
click: function(){
Ext.getCmp('b_save').enable();
Ext.getCmp('b_cancel').enable();
}
}
},
{
id: 'lastname',
header: 'Last Name',
dataIndex: 'lastname',
width: 220,
align: 'left',
editor: new fm.TextField({
allowBlank: false
}),
listeners: {
click: function(){
Ext.getCmp('b_save').enable();
Ext.getCmp('b_cancel').enable();
}
}
},
{
id: 'email_address',
header: 'Email Address',
dataIndex: 'email_address',
width: 330,
align: 'left',
editor: new fm.TextField({
allowBlank: false
}),
listeners: {
click: function(){
Ext.getCmp('b_save').enable();
Ext.getCmp('b_cancel').enable();
}
}
},
var grid = new Ext.grid.EditorGridPanel({
viewConfig: {
forceFit: true,
autoFill: true
},
id: 'maingrid',
store: store,
cm: cm,
width: 700,
anchor: '100%',
height: 700,
frame: true,
loadMask: true,
waitMsg: 'Loading...',
clicksToEdit: 2,
sm : new Ext.grid.RowSelectionModel({
singleSelect: true
,onEditorKey : function(field, e) {
if (e.getKey() == e.ENTER) {
var k = e.getKey(), newCell, g = this.grid,ed = g.activeEditor || g.lastActiveEditor;
e.stopEvent();
/*ed.completeEdit();*/
if(e.shiftKey){
newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
}else{
newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
}
if(newCell){
g.startEditing(newCell[0], newCell[1]);
}
}
else if(e.getKey() == e.TAB){
var k = e.getKey(), newCell, g = this.grid,ed = g.activeEditor || g.lastActiveEditor;
e.stopEvent();
newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
if(newCell){
g.startEditing(newCell[0], newCell[1]);
}
}
}
}),
});
You can add concatenated firstname and lastname and set it as value into your email_address field in listener for beforeedit editorgrid event:
listeners: {
beforeedit: function(e) {
if (e.field === 'email_address' && e.value === '') {
var newValue = e.record.get('firstname') + '.' + e.record.get('lastname');
e.record.set('email_address', newValue);
}
}
},
Fiddle with example: https://fiddle.sencha.com/#fiddle/3mf

how can i set extjs column in a function?

I have an EditorGridPanel which includes some columns but i want to change its type one of them to editor according to some values.
My column is below:
header: dil('Fiyat'),
width: 30,
sortable: true,
renderer: Ext.util.Format.numberRenderer('$0.000,00/i'),
dataIndex: 'fiyat'
but after changes, i want to work like:
header: dil('Fiyat'),
width: 30,
sortable: true,
renderer: Ext.util.Format.numberRenderer('$0.000,00/i'),
dataIndex: 'fiyat'
editor: new Ext.form.NumberField({
enableKeyEvents : true,
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
})
My entire code:
var po_combolu_toolbar2 = new Ext.Toolbar({
items: [
new Ext.form.ComboBox({
id: 'po_combo_id',
hiddenName: 'po_combo_hid',
name: 'po_combo_name',
store: PoTipStore,
valueField: 'id',
displayField: 'isim',
typeAhead: true,
triggerAction: 'all',
emptyText: dil('Tip Seçiniz'),
selectOnFocus: true,
anchor: '100%',
listeners: {
select: {
fn: function (combo, value) {
var modelCmp = Ext.getCmp('po_combo_id').getValue();
po_siparis_grid.store.setBaseParam("secim", modelCmp);
if (Ext.getCmp('po_combo_id').getValue() == 5) {
} else {
}
po_siparis_grid.store.load();
}
}
},
allowBlank: true
})]
});
var po_siparis_grid = new xg.EditorGridPanel({
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
ds: new Ext.data.GroupingStore({
reader: po_siparis_reader,
writer: po_siparis_writer,
autoSave: false,
baseParams: {
type: 'POSiparis'
},
proxy: new Ext.data.HttpProxy({
api: {
read: {
url: 'phps/POSiparisGetir.php?lang=dil(lang)',
method: 'POST'
},
create: 'app.php/users/create',
update: 'phps/POKayit.php?lang=dil(lang)',
destroy: {
url: 'app.php/users/destroy',
method: "DELETE"
}
}
}),
sortInfo: {
field: 'id',
direction: 'ASC'
},
listeners: {
save: function (store, batch, data) {
Ext.Msg.alert(dil('Mesaj'), dil('Kayıt Yapıldı.Teşekkürler.'));
window.bolgesel.siparisler.genel.mnt.dataStoreUpdate = 0;
},
update: function () {
window.bolgesel.siparisler.genel.mnt.dataStoreUpdate = 1;
}
},
groupField: 'grup'
}),
columns: [{
header: dil('Grup '),
width: 20,
sortable: true,
dataIndex: 'grup'
}, {
header: dil('Item No'),
width: 20,
sortable: true,
dataIndex: 'item_no'
}, {
header: dil('Kod'),
width: 40,
sortable: true,
dataIndex: 'code'
}, {
header: dil('Açıklama'),
sortable: true,
dataIndex: 'aciklama'
}, {
header: dil('Fiyat'),
id: "fiyat_column",
width: 30,
sortable: true,
renderer: Ext.util.Format.numberRenderer('$0.000,00/i'),
dataIndex: 'fiyat'
}, {
id: "tipikeadet",
header: dil('Adet'),
width: 30,
sortable: true,
dataIndex: 'adet',
editor: new Ext.form.NumberField({
enableKeyEvents: true,
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
})
}, {
header: dil('Toplam'),
width: 30,
sortable: true,
renderer: function (v, params, record) {
return Ext.util.Format.number(record.data.fiyat * record.data.adet, '$0.000,00/i');
},
dataIndex: 'toplam',
summaryType: 'totalCost',
summaryRenderer: Ext.util.Format.numberRenderer('$0.000,00/i')
}],
view: new Ext.grid.GroupingView({
forceFit: true,
showGroupName: false,
enableNoGroups: false,
enableGroupingMenu: false,
hideGroupedColumn: true,
startCollapsed: true
}),
plugins: summary,
frame: true,
width: 800,
height: 250,
clicksToEdit: 1,
collapsible: false,
animCollapse: false,
trackMouseOver: false,
enableColumnMove: false,
iconCls: 'siparis'
});
I want to change the fiyat column speficitation in the po_combolu_toolbar2 select function.

Resources