dhtmlxScheduler - new properties in events table - dhtmlx

I'm trying to enhance your table "events" but so far I have failed. I use yii framework, and when you add to the table a new field, for example "about", "worker", "client" when adding a new event, I don't see what would these fields appear in the form... While in the method "actionScheduler_data" I have clearly spelled out the line
$scheduler->render_table("events","event_id", "start_date, end_date, event_name, worker, client, rec_type,event_pid,event_length, event_about");
Help me pls!

The component does not add controls automaticaly, you need to redefine configuration of the form http://docs.dhtmlx.com/scheduler/lightbox_editors.html

Related

Spring Boot how i can add Entity in table?

pls help me understand how i can add Entity in table.
(Use Tutorial) I create Spring boot app - login/registration/home - with Security, SpringJpa, Hibernate and Thymeleaf. Tutorial it is always cool, but can i do something without that?
I decide to expend my app, and understand that i am real beginner.
So, my problem, i have home.html page, with Courses (three courses), that i want to add in my new page cabinet.html one of this course. New page have empty bootstrap table, but i want add course and see this entity in table!
link to view html page https://drive.google.com/drive/folders/1dnn-IKkpaBeouyqnGU13YLf1GBPVd_jQ?usp=sharing
My Question, after registration and login, what i need to write in backend, that on of my course appear after (click button add) in List Table in the Cabinet?
I think this is may be :
Course Entity (id, string name, string date) that saves to MySQL. Courses Repository. Courses service with method find-All or save? ServiceImpl, Controller, PostMapping with RequestParam?
And what thameleaf tegs i need to add in my table that field courses entity views in table? Pls help

Custom update in KendoUI datasource

I'm presenting a custom database view to the user in KendoUI, but my problem is that it's not updateable. My question is as follows: is there a way to write custom update behavior depending on which columns are being updated?
For instance, say I joined employees(id,name,dept_id) with department(id,dept_name) on department_id to form a table emp_dept(employee_id,employee_name,department_name). Say I was displaying emp_dept in Kendo and wanted to change the department names from the interface (and this was somehow impossible with a standard UPDATE statement). Could I write custom code for custom updates? For instance, in transport (and try not laugh at how basic/uninformed this looks as I'm still a noob):
update: {
url: function(options){
if(updating the employee name column)
return someserver:port/employees/employee_id
else if(updating the department name column)
return someserver:port/department/department_id
},
},
Hopefully you get the idea. Is this possible in KendoUI?

Modeling a form with an Auto-Suggest Lookup in Backbone.js

I have report UI with a small form at top where the user looks up a person by name using an Auto-Suggest textbox, and I set a hidden ID field when they select one. They then enter a start and end date, and hit submit to load a report below. The report data is fetched using the Person's ID, and the date range as a Backbone route. I can also show the person's name in the report header since I have it from the Auto-Suggest lookup.
The problem is, if someone bookmarks a report (a nice feature to have), I'd like to repopulate the form (which shows the person's name) and the report header.
So, currently I have one route ('id/startdate/to/enddate') that sometimes is triggered by an already populated form model, and sometimes is triggered by a bookmark/refresh and needs to repopulate the form model from route data and server-side data.
How would you model this? I was going to have a model bound to the form:
{ id: 234, name: 'Bill', startDate: '1/1/2011', endDate: '1/1/2012' }
But I am struggling with this idea of sometimes needing to fetch the name and populate the form, and sometimes already having a populated form (and name). Feels like there should be a better design for my Backbone views/models/routes.
You can populate your Model from the router by triggering a message with the name, startDate etc parameters that the Model will listen to.
The same thing can be done in the View that sets the data on the Model. So, regardless of where you get the information from (View, Router), your Model would correctly hold the state.
Then your Form View could listen on changes to its Model, re-rendering itself with pre-filled information on Model change.
Hope it helps.

problem with 'datatable' jquery plugin and two table (ajax related)

i have two tabs that their content loads by ajax. both have a table in their content. i want to apply 'datatable' jquery plugin to both table. tables have the same id because they are create by a function.but their rows are different.
datatable plugin is applied to first tab table well but on the second one give this error:
"DataTables warning (table id = 'dttable'): Cannot reinitialise DataTable.
To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster)."
i use "bDestroy":true in datatable plugin define.but in this way the plugin doesn't show in second table.
would you help me?
Your problem is that both tables have the same ID, which is invalid HTML. When you try to initialize the second Databable, your selector only finds the first table and tries to initialize Datatables on the first table again, which results in the error that you are getting.
You need to change your function to create each table with a unique ID and initialize each table by its respective ID.
Why not set the Datatables by a className rather than ID then it can apply to both of them?
When retrieving the data you can use something like $('.dataTableStyle').eq(1) to get information from the relevant one.
I'm using mvc3 and my problem was with initializing a dataTable in a view, then rendering a partial view with another dataTable. The issue was not in the id's of the 2 tables, but in the way the partial views get rendered in the framework. In my case, I had to move the script, or reference to the script, into the view that hosts the partial view. I had an issue similar to this using the Google Maps api.
try this code
$(document).ready(function() {
oTable = $('#DataTables_Table_0').dataTable({ //DataTables_Table_0 <-------table id
iVote: -1, //your field name
"bRetrieve":true
});
oTable.fnSort( [ [1,'desc'] ] );
});
use this in function event when you would change your table data
$('#tbl_resultates').dataTable().fnDestroy();
and add
"bRetrieve": true,
in
$('#tbl_resultates').dataTable({

Linq to Entities, EntityReferences and DataGridViews

I am trying to select certain fields from my entity to be used as the datasource for a datagridview, but I haven't been able to make it work. Is such a thing possible? For example, I have a Customers entity that contains several entityreferences. I want to take fields from the customers entity and from within those entityreferences and display them in the datagridview. I haven't been able to come up with a Linq query to accomplish this, and even when you simply use the entire entity as the datasource the fields within the entityreferences are not displayed. Any idea what I am doing wrong? Thanks for the help.
from customer in context.customers
select new
{
Name = customer.Name,
City = customer.Address.City
}
that will create a custom object and you can see the second property is referencing an entity field on the primary entity.. basically just transform the data to a new object and bind the enumerable generated to the grid.
sorry if this is a little mumbled, typing on my phone.
Caveat: This is not tested with entity framework references.
When using object data sources you can reference properties of object references, but you must first cast the object:
<asp:Label ID="lblCity" runat="server" Text='<%# ((Customer)Container.DataItem).Address.City%>'></asp:Label>
Could this be your problem accessing properties of the entity references?

Resources