Changeset 6338


Ignore:
Timestamp:
Oct 30, 2013, 9:03:09 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1775: Selecting items from a table return the ID as a string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2-stable/www/include/scripts/table.js

    r6028 r6338  
    353353      if (element != null)
    354354      {
    355         callback(element.value, element.title);
     355        // element.value should be a number, but just in case it is not...
     356        var id = element.value.match(/^\d+$/) ? parseInt(element.value) : element.value;
     357        callback(id, element.title);
    356358        numSelected = 1;
    357359      }
     
    364366        if (element.type == 'checkbox' && element.name.match(/\d+/) && element.checked)
    365367        {
    366           callback(element.name, element.title);
     368          // element.value should be a number, but just in case it is not...
     369          var id = element.value.match(/^\d+$/) ? parseInt(element.value) : element.value;
     370          callback(id, element.title);
    367371          numSelected++;
    368372        }
Note: See TracChangeset for help on using the changeset viewer.