Results 1 to 3 of 3

Thread: Problem for getting the text field value

  1. #1

    Exclamation Problem for getting the text field value

    pic3.jpgpic2.jpgpic1.jpgSankar.zip
    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();
    })
    }
    }
    });

  2. #2
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    please edit your post and use code tags: [CODE][/CODE]
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  3. #3

    Default

    Hi,
    When I tried to edit my post as what you told,it is showing that "your post is short".Please help me out.

Similar Threads

  1. Problem with text fields and field labels that wrap
    By irocker in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 24 Oct 2011, 4:21 AM
  2. Text Field BackGround color problem
    By Selvam packiam in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 24 Aug 2011, 2:56 AM
  3. Replies: 4
    Last Post: 8 Jul 2010, 8:18 PM
  4. Replies: 2
    Last Post: 1 Apr 2009, 4:05 PM
  5. DatePicker problem on a text field
    By ybs in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Oct 2008, 10:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •