Здесь у меня есть кнопка Add to library
. Как я могу добавить id
к нему?
Utils.dialog({
message: save_graph_canvassheet_html,
title: 'Add graph to canvas library',
buttons: {
'Add to library': function () {
var form = $(this).closest('.content');
var title = form.find('input[name="title"]').val()
var date_option = form.find('input[name="date_option"]:checked').val()
if (!title) {
alert($.i18n._('Please enter a title'));
return false;
}
Utils.status({
id: 'add_canvas_sheet',
text: 'Adding element to library'
})
graph_params.class_str = instrument_class_name;
delete graph_params.graph_height;
delete graph_params.graph_width;
delete graph_params._;
$.ajax({
url: '/ajax/CanvasSheet/add_element',
type: 'POST',
async: false,
data: {
title: title,
params: graph_params,
type: 'graph',
date_option: date_option
},
success: function (response) {
if (response.success) {
$('#canvassheets_dialog').trigger('refresh_elements');
}
Utils.status({
id: 'add_canvas_sheet'
})
}
})
}
},
modal: false
})