I have a treeView with multiple hierarchy, and only leaf/last node should have checkbox, not any parent should have checkbox.
I have refered many threads and examples. Tried Checkboxes Template but that makes another issue that values did not get binded with checkbox.
I need treeview like (https://jsbin.com/edamuj/131/edit?html,output)
@(Html.Kendo().TreeView()
.Name("treeview")
.Events(e => e.Select("OnSelectTree").DataBound("OnDataBound")).ExpandAll(true)
.Checkboxes(checkboxes => checkboxesName("checkedFiles"))
.BindTo((List<DPS.Model.ReviewDocumentTreeViewItemModel>)ViewBag.DocumentTreeData, (Kendo.Mvc.UI.Fluent.NavigationBindingFactory<TreeViewItem> mappings) =>
{
mappings.For<DPS.Model.ReviewDocumentTreeViewItemModel>(binding => binding.ItemDataBound((item, category) =>
{
item.Id = category.Id;
item.Text = category.Name;
item.Selected = category.IsSelected;
item.HtmlAttributes.Add("data-allowselection", category.AllowSelection);
item.Expanded = true;
item.Checked = category.IsReviewed;
}).Children(g => g.Items));
}))
Hello EveryOne,
I'm trying to change the dataSource of a MultiSelect widget.
This is my MultiSelect (in my CustomEditor):
@(Html.Kendo().MultiSelectFor(model => model.Person)
//.Name("FirmaAutoSelect")
.DataTextField(
"Name"
)
.MaxSelectedItems(1)
.AutoWidth(
true
)
.HtmlAttributes(
new
{ style =
"width:100%"
})
.Events(eve =>
{
eve.Open(
"onOpen_Person"
);
})
//.ValuePrimitive(true)
.DataSource(source =>
{
source.Custom()
//.ServerFiltering(true)
.Type(
"aspnetmvc-ajax"
)
.Transport(transport =>
{
transport.Read(
"Read_Personen"
,
"Person"
);
})
.Schema(schema =>
{
schema.Data(
"Data"
)
.Total(
"Total"
)
.Errors(
"Errors"
);
});
})
)
and i tried in the onOpen_Person function this code :
var
person_mult = $(
"#Person"
).data(
"kendoMultiSelect"
);
var
dataSource =
new
kendo.data.DataSource({
//batch: true,
transport: {
read: {
url:
"/Person/AlleOderFirma_Personen"
,
dataType:
"json"
},
// }
//});
parameterMap:
function
(options, operation) {
if
(operation !==
"read"
&& options.models) {
return
{ models: kendo.stringify(options.models) };
}
}
},
schema: {
model: {
id:
"Sid_personen"
,
fields: {
Sid_personen: { from:
"Sid_personen"
}
}
}
}
});
person_mult.setDataSource(dataSource);
Now this shows just one item and it's undefined !!
I console.Logged the dataSource and i saw that the "Sid_personen" is undefined .. but in "_data" i found all the items i need .. but it doesn't show them ..
in the attached picture you can see the consoleLogged DataSource.
and this is my ActionMethod:
public
ActionResult AlleOderFirma_Personen([DataSourceRequest]DataSourceRequest request)
{
//string g = Id_Firma;
using
(var db =
new
cRM_FM_v2_KARAMEntities())
{
IQueryable newQuery = db.PERSONEN.ToList().Select(prs =>
new
PersonViewModel()
{
Sid_personen = prs.SID_PERSONEN,
Name = prs.NAME,
Vorname = prs.VORNAME,
Recid_firmen = prs.RECID_FIRMEN,
Crmusername = prs.CRMUSERNAME
}).AsQueryable();
return
Json(newQuery.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
}
Hello,
I'm using a dropdown list to display a list of campaigns for a user to choose from. The dropdown list is part of a custom editor template for adding/editing donations. The campaigns are stored in a separate table, that has no cardinal relationship with the underlying donations table used by the template. In this use case scenario, the campaign table is being used as a lookup. The donation table simply stores the campaign name, nothing else is required beyond that, so no relationship is required.
The campaigns are being stored in a separate table because campaigns are often edited, added, or deleted independent of the rest of the application. There are also too many of them to either hard code or include in the markup.
For some reason, I'm not able to retrieve the data from the campaign table, something I thought would be pretty straightforward.
I'm including a .zip file containing the following relevant files:
Models
Donation.cs
Campaign.cs
Controllers
DonationsController.cs
CampaignController.cs
Custom Editor Template
DonationTemplate.cshtml
I'm not sure what I've done wrong here. This seems like it should pretty straightforward. Any advice/feedback would be very much appreciated.
Thank you!
I have a Grid with the search and filters enabled. I have placed the sprite files where they are supposed to go and still the buttons do not come up. What do I have to do to get the filter and search buttons to display? Is there a guide somewhere that explains what I need to do? I need for these buttons to display.
Bom dia, eu tenho uma grid dentro de um popup, esse popup recebe uma model com 5 propriedades e uma lista "opcoes". Eu gostaria de saber como populo essa grid com essa lista da model. Tentei conforme o codigo abaixo, mas sem sucesso.
@(Html.Kendo().Grid<Entidades.OpcaoPerguntas>(Model.Opcoes)
.Name("gridOpcao")
.Columns(columns =>
{
columns.Bound(o => o.CodigoOpcao).Visible(false);
columns.Bound(o => o.Ordem).Visible(false);
columns.Bound(o => o.DescricaoOpcao).Title("Descrição da Opção");
columns.Bound(o => o.DescricaoDivisor).Title("Divisor");
columns.Bound(o => o.DescricaoTipoOpcao).Title("Tipo de Opção");
columns.Bound(o => o.Meta);
columns.Bound(o => o.Pontos);
})
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(m => m.Id(i => i.CodigoOpcao)))
)
Html.Kendo().Grid<
Department
>()
CreateDate:Thu Jul 11 2013 11:54:13 GMT-0500 (Central Daylight Time)
public ActionResult UpdateDepartment([DataSourceRequest] DataSourceRequest request, Department department)
I have a grid of customer transactions and a child detail grid which expands the transaction into line info for the transaction. This works well but I only want the child detail grid to be available for rows on the parent with a certain transaction type id.
Is this possible?