Why am I getting jQuery error "ui.element is undefined"?

I have the following:

$('#widgets ul').sortable(
{
  connectWith: ['#widgets ul'],
  opacity: 0.7,
  start: function(e, ui) {
    fromWidgetPosition = ui.item.prevAll().length + 1;
    fromRowId = ui.element.attr('id');

I just upgraded jQuery from 1.2.6 to 1.3.2, and also updated the jQuery user interface library to the latest version.

+5
source share
1 answer

The "item" has been removed in new versions of jQuery UI, see this report for an error report and the corresponding set of source changes .

Accordingly, you should use $(this)instead:

fromRowId = $(this).attr('id');
+4
source

All Articles