Witam, mam sobie mini system stickow kiedy dodaje stick dane zapisuja sie do bazy i po wysjciu z dialogu moge sticky przesuwac, ale tylko raz kiedy przesunac chce np kolejnego sticka nie moge tego zrobic , dopiero po odswiezeniu strony wszystkie sticky staja sie draggable. Nie mam pojecia co moze to powodowacu:
function UpadeStickyDraggable(note,x, y, page_id, catalogue_id){
$.ajax({
url: "/sticky/UpdateStickyDraggable",
data: {
note: note,
x: x,
y: y,
page_id: page_id,
catalogue_id: catalogue_id
},
type: "POST",
cache: false,
success: function(res) {
},
complete: function(res){
}
});
}
function ReloadGrid(){
$("#list_sticky").jqGrid("setGridParam", {datatype: "json"}).trigger("reloadGrid");
}
var width = $('#image').css('width');
var height = $('#image').css('height');
width = parseInt(width);
height = parseInt(height);
var x;
var y;
var sticky_preview_id = $('#sticky_preview_id').val();
var page_id = $('#page_id').val();
var catalogue_id = $('#catalogue_id').val();
var note;
$('.viewport').live('mousemove',function(e){
x = e.pageX - this.offsetLeft;
y = e.pageY - this.offsetTop;
x = x/width;
y = y/height;
});
$('.marker').live('mouseenter', function(e){
note = $(this).text();
$(this).css({
cursor: 'move'
});
$(this).css({
opacity: 0.5
});
$(this).draggable({
cursorAt: {
left: 12,
top: 29
},
disabled: false,
stop: function(){
UpadeStickyDraggable(note,x, y,page_id, catalogue_id);
$("#image").imgNotes("clear");
ReloadGrid();
GetAllSticks();
}
});
}).live('mouseleave',function(){
$(this).draggable({
disabled: true
});
$(this).css({
opacity: 1
});
});
Jakies pomysly?