Hi,
Currently the scheduler has Clone Events to demonstrates how to clone events in the Scheduler. But how we can copy and paste an event on scheduler.
Regards.
noRecords: {
template: "nessun elemento"
},
This is my kendo grid with mvvm.
<
div
id
=
"a"
data-role
=
"grid"
data-no-records
=
"templateNoRecords"
data-columns="[
{ 'title': 'ID', 'field': 'id' },
{ 'title': 'ID', 'field': 'id' }
]"
data-bind
=
"source: products.source,"
>
<
script
id
=
"templateNoRecords"
name
=
"templateNoRecords"
type
=
"text/x-kendo-template"
>
Nessun dato trovato
</
script
>
noRecords: {
template: "nessun elemento"
}
I'd like to do this but with mvvm.
This is my kendo grid:
<
div
id
=
"a"
data-role
=
"grid"
data-no-records
=
"templateNoRecords"
data-columns="[
{ 'title': 'ID', 'field': 'id' ,hidden: true },
{ 'title': 'Nome', 'field': 'nome' },
]"
data-bind
=
"source: products.source}"
>
<
script
id
=
"templateNoRecords"
name
=
"templateNoRecords"
type
=
"text/x-kendo-template"
>
Nessun dato trovato
</
script
>
</
div
>
I have this code:
kendo.ui.Grid.prototype.options =
$.extend(true, kendo.ui.Grid.prototype.options,{
noDataTemplate:"NoData",
noRecordsTemplate:"NoData",
noRecords:"NoData"
});
this code doesn't work!
There is a bug in the following scenario:
1. Go to the following example: http://dojo.telerik.com/AWihI/2
2. Sort by ProductName
3. Go to the last page
4. Click "Add New Record". It does not show the new row at the bottom of the current page.
While if you do the following scenario, it works:
1. Go to the following example: http://dojo.telerik.com/AWihI/2
2. Go to the last page
3. Click "Add New Record". It shows the new row at the bottom of the current page
i have external localization file for dropdownlist.
/* DropDownList messages */
if (kendo.ui.DropDownList) {
kendo.ui.DropDownList.prototype.options.messages =
$.extend(true, kendo.ui.DropDownList.prototype.options.messages,{
"<message-name>": "<translation",
noDataFound:"ciao"
});
}
noDataFuond is definitely wrong.
What should I write to set the no-data parameter of dropdownlist?
Then i used the template to set this properties, but now i'd like to create external file for this message.
At the first rendering of a page I would like to specify and process the selection of a default autocomplete value. I thought this code might work, it doesn't:
$(document).ready(
function
() {
var
ac = $(
"#autoComplete"
).data(
"kendoAutoComplete"
);
var
target =
"170035"
;
ac.search(target)
.then(ac.select(target))
.then(ac.trigger(
"change"
))
;
})
AutoComplete search() does not return a promise. A promise would be needed for the .then() chaining I want to do. For comparison, DataSource read() does return a promise and can be part of a chain.
Q: Can you suggest a different approach for search and select ?
Thanks, Richard
I have a model with two field (Code and Item). The Code is set to auto increment and the Item is a required field. When I clicked the Add New Record button, the Code column was set to 0 in the Popup. After I add a new record, the Code field in the grid was set to 0 even I return the model with the new record.
Model:
public partial class HousenMokutekiD
{
public int Code { get; set; }
[Required]
[StringLength(20, MinimumLength = 3)]
public string Item { get; set; }
}
Controller:
public ActionResult Create([DataSourceRequest]DataSourceRequest request, HousenMokutekiD model)
{
if (string.IsNullOrWhiteSpace(model.Item))
{
ModelState.AddModelError("", "Item is required.");
}
if (model != null && ModelState.IsValid)
{
var entity = new HousenMokutekiD();
if (model.Item != null)
{
entity.Item = model.Item;
}
_context.HousenMokutekiD.Add(entity);
_context.SaveChanges();
model.Code = entity.Code;
model.Item = entity.Item;
}
return Json(new[] { model }.ToDataSourceResult(request, ModelState));
}
Razor:
@model IEnumerable<Sms.Office.Data.PmsDd.Models.HousenMokutekiD>
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Command(command =>
{
command.Edit().UpdateText("Save Changes");
command.Destroy();
}).Width(162);
columns.Bound(p => p.Code);
columns.Bound(p => p.Item);
})
.ToolBar(add =>
{
add.Create();
})
.Editable(editable =>
{
editable.Mode(GridEditMode.PopUp);
editable.Window(w => w.Title(""));
})
.Events(e =>
{
e.Edit("onEdit");
})
.Navigatable()
.Pageable()
.Sortable()
.Selectable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(7)
.Events(events =>
{
events.Error("error_handler");
events.RequestEnd("request_end");
})
.Model(model =>
{
model.Id(p => p.Code);
})
.Read(read => read.Action("Read", "Purpose"))
.Create(create => create.Action("Create", "Purpose").Type(HttpVerbs.Post))
.Update(update => update.Action("Update", "Purpose").Type(HttpVerbs.Put))
.Destroy(destroy => destroy.Action("Destroy", "Purpose").Type(HttpVerbs.Delete))
)
)
Please help me. Sorry I am a newbee in MVC