• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

vvIn_time API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • vvIn_time API

    I'm struggling to figure out what this does. I have a database field which is a Time variable. I've coded the extjs with a Timefield. Now, Sencha has an issue because the submitFormat does not work, it is sending in a full date/time stamp even though I'm telling it "H:i:s". Maybe that is breaking your API. But when I use API to load the Time field, it is not getting a value, showing "00:00:00", instead of the "14:00:00" I was expecting. What is passed in is something like "2018-11-12T14:00:00". Anything I can do here or do I just need to retrieve as char or date and parse out the time component?

  • #2
    Terry,

    What version of Ext are you using? I was able to set up an example with Sencha Fiddle that posts two time fields values with the correct format.

    Sencha Fiddle - open up developer tools then set the time fields and click submit. You will see a request "testRequest" in the network traffic that is passing the two time values correctly so that you could use vvIn_time.

    Example Form
    Code:
           Ext.create('Ext.form.Panel', {
                itemId: 'myForm',
                title: 'Time Card',
                width: 300,
                bodyPadding: 10,
                renderTo: Ext.getBody(),
                items: [{
                    xtype: 'timefield',
                    name: 'in',
                    fieldLabel: 'Time In',
                    minValue: '6:00 AM',
                    maxValue: '8:00 PM',
                    increment: 30,
                    anchor: '100%',
                    submitFormat: 'H:i:s'
                }, {
                    xtype: 'timefield',
                    name: 'out',
                    fieldLabel: 'Time Out',
                    minValue: '6:00 AM',
                    maxValue: '8:00 PM',
                    increment: 30,
                    anchor: '100%',
                    submitFormat: 'H:i:s'
                }],
                bbar: [{
                    text: 'Submit',
                    handler: me.submitForm
                }]
            });
    Sencha Fiddle Time Field Example.png

    Network:

    Sencha Fiddle Form Submit.png

    Comment


    • #3
      Well, what the heck Johnny? I'm using the version you ship with Val 5.2, one of the 6 versions. I saw that exact example you used in forum post. What did you do in the store/model field definition? Anything as far as setting type received from server?
      Code:
      header: '<b>Start Time</b>', width: 100, sortable: false, dataIndex: 'PHSTRTM', editor: { xtype: 'timefield', format: 'H:i:s', submitFormat: 'H:i:s', selectOnFocus: true }, renderer: function(val, x, store){ return '<div class="vv-griddescription">' + Ext.util.Format.date(val, 'H:i:s') + '</div>'; }

      Comment


      • #4
        I see the disconnect, Johnny. It works fine in a form post, does not work in RowEditor post. Likely some bug with Sencha. I'll just have to work around it. Thanks for adding some clarity!

        Comment

        Working...
        X