AnsweredAssumed Answered

Jquery Datatable create a manual ID field

Question asked by alex.gole_ELDORADOCOUNTY on Dec 2, 2016
Latest reply on Dec 8, 2016 by alex.gole_ELDORADOCOUNTY

Hello all,

I would like the user to be able to input an ID (same ID for all selected features) to a table via an input textbox. I keep getting mixed results.

 

This wont work:

 

var input;
$("#tesr").change(function () {
                  console.log($("#tesr").val());
                  input = $("#tesr").val();
              });

$.each(featureSet.features, function (index, value) {
                      row = [];
                      row.push(input);
                     
                      $.each(value.attributes, function (index2, value2) {
                          row.push(value2);
                      });
                      data.push(dojo.clone(row));
                  });

 

if it is hard coded then it will work as wanted:

$.each(featureSet.features, function (index, value) {
                      row = [];
                      row.push("22");
                     
                      $.each(value.attributes, function (index2, value2) {
                          row.push(value2);
                      });
                      data.push(dojo.clone(row));
                  });

I am not sure what I am missing. Thanks,

Alex

Outcomes