date and time edit with editor Widget

931
1
09-11-2011 06:50 AM
SylvainKerdreux
New Contributor
Hello,

I do not succeed in editing a time and date field using editor widget.
Indeed with the attribute inspector I can only choose the date but not the time.
If I use  "customField" I can use dojo datePicker or dojo timePicker but not together.

below the code I used to edit a feature :
         var featureLayer = results[0].layer;
 
          var templatePicker = new esri.dijit.editing.TemplatePicker({
          featureLayers: [featureLayer],
          rows: 'auto',
          groupingEnabled:false,
          columns: 1
        },'editWidget');
        templatePicker.startup();

  
 var conteneur = new dijit.layout.ContentPane({content: '<input type="text" dojoType="dijit.form.TextBox"><br/><input type="text" dojoType="dijit.form.TextBox">',region: "center"});
       
       var layerInfos = [{
          'featureLayer':featureLayer,
          'showAttachments':false,
          'showDeleteButton':false,
          'fieldInfos':[
            {'fieldName':'t1','label':'t1','customField':conteneur},
            {'fieldName':'t2','label':'t2'},
            {'fieldName':'ID','label':'ID'}
          ]
        }];   
        
        //define the editor settings
        var settings = {
          map: map,
          templatePicker:templatePicker,
          layerInfos:layerInfos
        };
        
        var params = {settings: settings};

        //Create the editor widget 
        var editorWidget = new esri.dijit.editing.Editor(params);
        editorWidget.startup();
        
        //resize the info window (attribute inspector)
        map.infoWindow.resize(295,245);


So, is it possible to edit the time AND date on a date field ?
If yes how is it possible ?

Regards,
Sylvain
0 Kudos
1 Reply
DavidHollema
New Contributor III
Any solution for this?

I have a partial solution.  Using DateTimeCombo widget -> http://bugs.dojotoolkit.org/ticket/7946.

I use a customField in the fieldInfos array on my date field.  The control displays fine in the Editor widget but the ultimate chosen value is not sent to ArcGIS Server across the wire.  I've tried with other dojo widgets in a customField scenario and see the same problem.  I can't get the attribute inspector/editor to actually get the value of the customField widget.
0 Kudos