I have a grid/form/dataprocessor working together but just noticed the following problem. When loading the page I create the dataProcessor and bind it with the grid. When displaying the form I use form.bind(grid) then form.save().
The problem is the form has more fields than the grid and I noticed the dataProcessor is being sent only the grid columns (subset of the form fields). What is the best solution to get all 3 of these working together?
Are there any limitations with datastore and smart/dynamic rendering? I was using a data store at one point but switched possibly to get dynamic rendering to work (can’t remember exactly).
In latest version there must not be any limitations.
You can use sync grid with datastore which does use dynamical data loading ( dyn. loading configured for the store, not for the grid )
I’m not sure where I asked this originally but I’ll a follow up here.
obj = form.getFormData();
var recid = (new Date()).valueOf();
obj.id = recid;
datastore.add(obj);
grid.selectRow(grid.getRowIndex(recid));
So all the above is working, adds a record to datastore/grid and selects the newly added row.
Question, after the above is there a way to get the record id returned from the data processor? Data processor is passed sid and returns tid so I just need to get the tid at this point.
Another question related to my setup above. My grid has a few columns of type dhxCalendar. The field is defined in the form with these 3 parameters (and some others)
When using form.save() the date fields are sent to the DP with the correct format. However, my form has an additional date field which is not on the grid and that is being saved as “Tue Jul 16 2013 14:10:00 GMT-0700 (Pacific Standard Time)”. How do I get those dates to format properly?
It is a bit complicated.
Form can return dates as date objects or as formatted strings.
To have correct integration with calendar columns in grid - it must be a date object, but for saving not linked to grid fields - you need the formatted string.
That allowed the date to send properly. What are my options for also adding a time value? I think my problem is having both a date only and datetime value on the same record type. This seems to be working on another grid which only has 1 datetime field, but the grid I’m working on now has 2 date fields and 1 datetime field, so its setDateFormat uses date only.
var obj = form.getFormData();
obj.AlarmTime.setHours(obj.alarmhour);
obj.AlarmTime.setMinutes(obj.alarmminute);
The above works on another grid which only has datetime values
That worked, for adding new records I am having a similar problem, maybe because its not saving directly to the grid but not sure where to specify a format or bind if that’s even needed.
var obj = form.getFormData();
if(edit)
{
form3e.setFormData(obj); //This saves dates in correct format “YYYY-MM-DD”
form3e.save();
}
else
datastore.add(obj); //This sends date with wrong format to datastore