Skip to content

Replies

0
Ray Webb
Ray Webb answered on Jan 21, 2016 2:13 PM

I've attached a file that demonstrates the problem.

Run, then click on any Population field to place into edit mode. I get the error "Uncaught TypeError: $(…).igEditor is not a function".

Click on another cell and place into edit mode and another error also occurs, "Uncaught TypeError: Cannot read property 'focus' of undefined".

0
Ray Webb
Ray Webb answered on Jan 20, 2016 1:39 PM

I do continue to have the problem using the igEditor with the igLoader as described in an earlier post.

0
Ray Webb
Ray Webb answered on Jan 20, 2016 1:08 PM

I found the source of my problem. I was setting the regional option when executing the igLoader. The regional value came from a call to a function. However, without realizing it the function was always returning "en" rather than "en-GB" for the machine I was testing on. After I corrected the function everything worked as expected.

0
Ray Webb
Ray Webb answered on Jan 19, 2016 8:51 PM

I have been unable to get the desired date format in a grid using the igLoader.

I've attached a file that includes code to display a datepicker using the igLoader (DatePickerTestImplicit) and without using the igLoader (DatePickerTestExplicit). I tested the code on a machine whose locale and language was set for English (UK). The code without the igLoader works fine. The one with the igLoader doesn't work (i.e. the date is in format mm/dd/yyyy rather than dd/mm/yyyy).

I'm still uncertain how the igLoader is supposed to be used to get the correct date format based upon the current locale. Is there something wrong with how I'm instantiating the igLoader?

0
Ray Webb
Ray Webb answered on Jan 19, 2016 8:06 PM

I'm experiencing a problem using the igLoader. I have the following defined in my code instantiate the igLoader.

<script type="text/javascript" src="http://cdn-na.infragistics.com/igniteui/2015.2/latest/js/infragistics.loader.js"></script&gt;

<script type="text/javascript">
function getLang()
{
 var lang;
 if (navigator.browserLanguage != undefined)
  lang = navigator.browserLanguage;
 else if (navigator.languages != undefined)
  lang = navigator.languages[0];
 else
  lang = navigator.language;
 
 if (lang = "en-US") lang = "en";
 
 return lang;
}

var myLang = getLang();

$.ig.loader({
 scriptPath: "http://cdn-na.infragistics.com/igniteui/2015.2/latest/js/&quot;,
 cssPath: "http://cdn-na.infragistics.com/igniteui/2015.2/latest/css/&quot;,
 resources: "igGrid.Updating,igGrid.Resizing,igGrid.Selection,igGrid.ColumnFixing,igDialog",
 autoDetectLocale: true,
 regional: myLang
 });
</script>

I also have an event handler defined on an igGrid to modify a cell's behavior when the cell enters edit mode (see behow). However, the statement that references the igEditor function yields the error "Uncaught TypeError: $(…).igEditor is not a function". This doesn't occur when I don't use the igLoader. I assume I need to include an additional resource, however, I don't know which resource to add. I've tried "igEditor" and that yields an error when the igLoader function executes. I've tried "igEditors" which yields no errors when igLoader executes but doesn't resolve the problem when the function below executes.

    $("#gridAgeDataAddEdit").on("iggridupdatingeditcellstarted", function (evt, ui) {
     // We will only modify the AgeValue column
     if (ui.columnKey == "AgeValue") {
      // Get a javascript object for the current record
      var recordObj = ui.owner.grid.findRecordByKey(ui.rowID);
      var field = '';
      
      // Get the current value in column AgeDataType
      if (recordObj) {
       field = recordObj.AgeDataType;
      }
      switch (field) {
       // If the current age value is an integer, do not allow decimal data or values < 0
       case 'integer':
        $(ui.editor).igEditor("option", "maxDecimals", 0);
        $(ui.editor).igEditor("option", "minValue", 0);
        break;
       // If the current age value is a numeric, allow up to 2 decimal places, but no values < 0
       case 'numeric':
        $(ui.editor).igEditor("option", "maxDecimals", 2);
        $(ui.editor).igEditor("option", "minValue", 0);
        break;

      }
     }
    });