【发布时间】:2014-06-05 18:26:09
【问题描述】:
我有一个 gridster 网格正在工作,我正在尝试获取已调整大小的 <li> 项目的 ID。
resize: {
enabled: true,
stop: function (e, ui, $widget) {
//Need the id of the item that was just resized
}
}
【问题讨论】:
我有一个 gridster 网格正在工作,我正在尝试获取已调整大小的 <li> 项目的 ID。
resize: {
enabled: true,
stop: function (e, ui, $widget) {
//Need the id of the item that was just resized
}
}
【问题讨论】:
您是否考虑过:
$widget.attr('id');
【讨论】:
我意识到我的问题在于我在 gridster 中序列化了参数:
serialize_params: function ($w, wgd) {
return {
DataTypeId: wgd.el[0].id,
Column: wgd.col,
Row: wgd.row,
SizeX: wgd.size_x,
SizeY: wgd.size_y
}
},
所以在我的“停止”事件中我可以使用:
var newDimensions = this.serialize($widget)[0]
newDimensions.DataTypeId
【讨论】: