PDA

View Full Version : Problem for getting the text field value



sankarbaluz
11 Mar 2011, 7:26 AM
25096250972509825099
Hi,
I am challenging to get the solution of getting text field values dynamically in my project.The application is while clicking on the tree nodes the textfields according to the node should display dynamically.Thats working perfectly.The problem is while clicking on the "Submit" button,the value is getting only at one time.I am attaching the code with my application images with this thread,Please help me out.



var TeamMemberDetails = new Ext.tree.TreePanel
({
title: 'Member Report',
autoScroll: true,
animate: true,
region:'west',
enableDD: false,
id:"mainTree",
containerScroll: true,
//renderTo: Ext.getBody(),
dataUrl: 'projectPHP/get-nodes.php',
width: 250,
height: 400,
listeners:
{
click: function(node,event)
{

var getID = node.id;
var getName=node.text;
var empNameStore = new Ext.data.JsonStore
({
url: 'projectPHP/teamMemberDetails.php',
root: 'categories',
method: 'POST',
autoLoad:true,
baseParams:{getName:getName},
fields: ['name','userid','reportingTo','jobType','projectHandling','extnNumber','projectStarted'],
listeners:
{
load:function(record)
{
empNameStore.each(function(record)
{
var userid = record.data.userid;
var extnNumber = record.data.extnNumber;
var userName = record.data.name;
var projectHandling = record.data.projectHandling;
tabs2.add
({
title:getName,
id:'tabDetails'+userid,
closable:true,
layout:'column',
bodyStyle:'padding:15px 15px 15px 35px',
border:false,
buttonAlign:'center',
items:
[
{
columnWidth:.3,
layout: 'form',
id:"mainForm"+getID,
border:false,
items:
[
{
xtype:'textfield',
fieldLabel: 'Employee ID',
id:'empID'+getID,
name: 'first',
value:record.data.userid,
anchor:'95%'
},
{
xtype:'textfield',
id:'extnNo'+getID,
fieldLabel: 'Extn. Number',
value:extnNumber,
name: 'last',
anchor:'95%'
},
{
xtype:'textfield',
id:'noOfLeads'+getID,
allowBlank:false,
fieldLabel: 'No: Of Leads',
name: 'numbrLeads'+getID,
anchor:'95%'
},
{
xtype:'textfield',
id:'qualifiedLeads'+getID,
fieldLabel: 'Qualified Leads',
name: 'company',
anchor:'95%'
},
{
xtype: 'checkboxgroup',
fieldLabel: 'Appreciation',
itemCls: 'x-check-group-alt',
columns: 1,
items:
[
{boxLabel: 'Customer Appreciation', name: 'rb-col', inputValue: 1},
{boxLabel: 'Internal Appreciation', name: 'rb-col', inputValue: 2, checked: true}
]
}
]
},
{
columnWidth:.3,
layout: 'form',
border:false,
items:
[
{
xtype:'textfield',
id:'empName'+getID,
fieldLabel: 'Employee Name',
name: 'last',
value:node.text,
anchor:'95%'
},
{
xtype:'textfield',
id:'projects'+getID,
fieldLabel: 'Project',
value:record.data.projectHandling,
name: 'last',
anchor:'95%'
},{
xtype:'textfield',
id:'target'+getID,
fieldLabel: 'Target',
name: 'targt',
anchor:'95%'
},
{
xtype:'textfield',
id:'disqualifiedLeads'+getID,
fieldLabel: 'DQ Leads',
name: 'company',
anchor:'95%'
},
{
xtype:'textfield',
id:'avgTalktime'+getID,
fieldLabel: 'Avg.Talktime',
name: 'avgTalktime',
anchor:'95%'
}
]
},
{
columnWidth:.3,
layout: 'form',
border:false,
items:
[
{
xtype:'textfield',
id:'role'+getID,
fieldLabel: 'Role',
name: 'last',
value:record.data.jobType,
anchor:'95%'
},
{
xtype : 'datefield',
id:'projectStarted'+getID,
format: "Y-m-d",
name: 'projectDate',
readOnly:true,
value:record.data.projectStarted,
fieldLabel: 'Project Started',
anchor:'95%'
},
{
xtype : 'datefield',
id:'leadDate'+getID,
format: "Y-m-d",
readOnly:true,
name: 'leadDate',
value:new Date().add(Date.DAY, 0),
fieldLabel: 'Lead Date',
anchor:'95%'
},
{
xtype:'textfield',
id:'YTQLeads'+getID,
fieldLabel: 'YTQ Leads',
name: 'YTQLeads',
anchor:'95%'
},
{
xtype:'textfield',
id:'calls'+getID,
fieldLabel: 'No: Of Calls',
name: 'last',
anchor:'95%'
}
]
}
],
buttons:
[
{
text:'Submit',
id:'btnSubmit'+getID,
listeners:
{
click:function()
{

var empID = Ext.getCmp("empID"+getID).getValue();
var empName=Ext.getCmp("empName"+getID).getValue();
var empRole=Ext.getCmp("role"+getID).getValue();
var empProject=Ext.getCmp("projects"+getID).getValue();
var empLeads=Ext.getCmp("noOfLeads"+getID).getValue();
var empCalls=Ext.getCmp("calls"+getID).getValue();
var leadDate=Ext.getCmp("leadDate"+getID).getValue();
var TodayDate = new Date().add(Date.DAY, 0);
alert(empLeads);


Ext.Ajax.request
({
url: 'projectPHP/submitDailyReport.php',
method: 'POST',
params :
{
empID:empID,
empName:empName,
empRole:empRole,
empProject:empProject,
empLeads:empLeads,
empCalls:empCalls,
leadDate:leadDate
},
success: function (result, request)
{
alert("Success");
Ext.getCmp('southGrid').getStore().load({params:{empID:empID}});

//Ext.getCmp("mainTree").getSelectionModel().getSelectedNode().disable();


//tabs2.remove('tabDetails'+userid,true);
},
failure: function ( result, request )
{
alert("FAIL");
}
});

}
}
},
{
text:'Cancel'
}
]

}).show();
})
}
}
});

steffenk
11 Mar 2011, 8:19 AM
please edit your post and use code tags:

sankarbaluz
15 Mar 2011, 10:52 PM
Hi,
When I tried to edit my post as what you told,it is showing that "your post is short".Please help me out.