Skip to content
Snippets Groups Projects
Commit 4640893c authored by PavelBegunkov's avatar PavelBegunkov
Browse files

...

parent c09c195f
Branches
Tags
No related merge requests found
......@@ -10,19 +10,22 @@ function BindGroup(id, StudyGroupName){
}
// Прикрепить группу
$('.AttachGroupButton').click(function(){
var StudyGroupID = $('.SelectStudyGroup').val();
var StudyGroupName = $(".SelectStudyGroup option:selected").text();
$('.AttachGroupButton').click(function()
{
var jSelector = $(this).prev();
var StudyGroupID = jSelector.val();
var StudyGroupName = jSelector.children("option:selected").first().text();
$.post(
URLdir + 'handler/map/BindGroup',
{
'StudyGroupID': StudyGroupID,
'DisciplineID': DisciplineID
},
function(data){
function(data)
{
data = $.parseJSON(data);
if(data.success === true) {
$('.AttachedGroupsList').append(BindGroup(StudyGroupID, StudyGroupName));
jSelector.parent().next().append(BindGroup(StudyGroupID, StudyGroupName));
EventInspector_ShowMsg('Группа добавлена', 'success');
}
else EventInspector_ShowMsg('Ошибка при добавление группы', 'error');
......@@ -31,16 +34,18 @@ $('.AttachGroupButton').click(function(){
});
// Отсоединить группу
$('.AttachedGroupsList').on('click', '.UnbindGroup', function(){
var StudyGroupID = $(this).parent().attr('id');
$('.AttachedGroupsList').on('click', '.UnbindGroup', function()
{
var GroupDIV = $(this).parent();
var StudyGroupID = GroupDIV.attr('id');
$.post(
URLdir + 'handler/map/UnbindGroup',
{
'StudyGroupID': StudyGroupID,
'DisciplineID': DisciplineID
},
function(data){
function(data)
{
data = $.parseJSON(data);
if(data.success === true) {
GroupDIV.remove();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment