Another question:
After "New entry" or after "Delete entry" calendar not refreshing automaticaly.
I need refresh browser (F5) or run report again.
~~~~~~
Delete procedure:
create procedure sp_DBR_Xrpt021_Posedziai_Calendar_Delete (@in_id bigint)
as begin
delete from CelsisNorma.dbo.Xrpt021_Posedziai where Id = @in_id
select 'dbr.javascript', "$('.mycal').fullCalendar( 'refetchEvents' )";
end
~~~~~~
New procedure:
create procedure sp_DBR_Xrpt021_Posedziai_Calendar_New (@in_calendar_id varchar(12), @in_from datetime, @in_to datetime, @in_entry varchar(1000))
as begin
insert into CelsisNorma.dbo.Xrpt021_Posedziai ( Kabinetas, Nuo, Iki, Pastaba )
values ( @in_calendar_id, @in_from, @in_to, @in_entry );
select 'dbr.javascript', "$('.mycal').fullCalendar( 'refetchEvents' )";
end
~~~~~~
Calendar data:
~~~~~~
create procedure sp_DBR_Xrpt021_Posedziai_Calendar_Data (@in_from date, @in_to date, @in_calendar_id varchar(12))
as begin
select 'dbr.cellstyle', 'entry', 'style'
select 'dbr.calendar.options', 'editable', '', 'sp_DBR_Xrpt021_Posedziai_Calendar_Edit', 'id'
select 'dbr.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_Delete','[entry]', 'in_id=id', "misc[]", 'callbefore=confirmdel', '"dbr.html:<span style="color:red">Delete event</span>"';
select 'dbr.calendar.options', 'event.id', 'id';
SELECT Nuo as datetime_from, Iki as datetime_to, Pastaba as entry, Style as style, ID as id
FROM CelsisNorma.dbo.Xrpt021_Posedziai
where Kabinetas=@in_calendar_id and cast(Nuo as date) <= @in_to and isnull(cast(Iki as date), @in_from) >= @in_from;
end
~~~~~~
Calendar:
~~~~~~
create procedure sp_DBR_Xrpt021_Posedziai_Calendar (@in_calendar_id varchar(12))
as begin
select 'dbr.javascript','
function confirmdel(obj) {
return confirm("Are you sure you want to delete the entry?");
}';
select 'dbr.calendar', 1000;
select 'dbr.calendar.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_Data', @in_calendar_id
select 'dbr.calendar.options', 'new', 'newentry', 2;
select 'dbr.calendar.options', 'selectable', 1;
select 'dummy';
select 'dbr.button', '<i class="fa fa-plus" aria-hidden="true"></i> New calendar entry', 'newentry button';
select 'dbr.report', 'sp_DBR_Xrpt021_Posedziai_Calendar_New', 'misc[]', 'in_calendar_id=in_calendar_id'
select @in_calendar_id as 'in_calendar_id'
end
~~~~~~