Hi,
on your demo page for ASP.NET Core MultiColumnComboBox Server Filtering when I enter Ali, then a request is sent to the server with querystring text=Ali and two records are shown.
When I click on one of the records and then expand the combox box again using the down arrow, then another request is send to the server but with empty text, so all records are returned.
This is problem when server contains a lot of records.
Is there a way how to send to the server the text shown in the input field? I need it to show just the one record like if I just entered the text in the field manually.
Regards,
Petr
Hi,
I'm struggling to change the mouse pointer when selecting a value inside MultiColumnComboBox. Before opening, the mouse pointer looks correct, but then it opens and the cursor attribute doesn't seem to apply.
I tried .HtmlAttributes(new { style = "cursor:pointer;"})
Thoughts or ideas?
Thanks,
Sam
Hello guys,
is there any example showing how to achieve the virtualization on multicolumncombobox (or dropdownlist or combobox) but with local data and not with remote?
Thanks.
I am about to plan a purchase with a new customer again for the suite and I am using the latest demo. I was trying to get the value from the form that I placed my control in. I need to gain access in this field .DataValueField("Id") which would be bound to the form when its posted but when I access tag item its null
<
form
asp-action
=
"LinkToCase"
asp-controller
=
"MISObjects"
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-12"
>
<
div
class
=
"card card-success"
>
<
div
class
=
"card-header"
style
=
"background-color:#1e3f5a;color:white"
>
<
h3
class
=
"card-title"
>Search and Tag</
h3
>
</
div
>
<
div
class
=
"card-body"
>
<
div
class
=
"col-md-12"
>
<
div
class
=
"input-group"
>
<
select
id
=
"searchOptions"
name
=
"searchOptions"
style
=
"background-color: #1e3f5a; color: white; width: 140px; height: 45px"
>
<
option
selected
value
=
"1"
>Poi</
option
>
<
option
selected
value
=
"1"
>Vessel</
option
>
</
select
>
@(Html.Kendo().MultiColumnComboBox()
.Name("tagItem")
.DataTextField("name")
.DataValueField("Id")
.Filter("contains")
.FilterFields(new string[] { "name", "ContactTitle", "CompanyName", "Country" })
.Columns(columns =>
{
columns.Add().Field("name").Title("Contact Name").Width("200px");
columns.Add().Field("dob").Title("Date Of Brith").Width("200px");
})
.FooterTemplate("Total #: instance.dataSource.total() # items found")
.HtmlAttributes(new { style = "width:80%;" })
.Height(400)
.DataSource(source => source
.Custom()
.Transport(transport => transport
.Read(read =>
{
read.Action("SearchQuery", "MISObjects")
.Data("onAdditionalData");
}))
)
)
<
button
class
=
"btn-primary"
value
=
"Link To Case"
style
=
" background-color:#1e3f5a;color:white"
>Link To Case</
button
>
</
div
>
<
script
>
function onAdditionalData() {
return {
text: $("#customers").val()
};
}
</
script
>
public IActionResult LinkToCase(int tagItem, string sesearchOptionsr) {
Int32.TryParse(TempData.Peek("CaseId").ToString(), out int resultCaseId);
POI newPoi = new POI();
newPoi = _context.Pois.SingleOrDefault(w => w.Id == tagItem);
newPoi.MISObjectId = resultCaseId;
_context.Pois.Add(newPoi);
_toast.AddSuccessToastMessage(
$"You have linked {newPoi.FirstName} {newPoi.LastName} to case {resultCaseId:d8}");
return RedirectToAction("Edit", new { id = resultCaseId });
}
Suppose I have a MultiColumnComboBox like below. How can I have like 10 columns in it but hide specific ones of them? I need the data from the additional columns when the user makes a selection but, I don't want them to show. So in the example below, how could I hide the ID, and Inst columns? I think it would be done in the dataBound event but no idea how to do it.
--Rich
@(Html.Kendo().MultiColumnComboBox()
.Name("MainSched")
.DataTextField("Room")
.DataValueField("Room")
.Columns(columns =>
{
columns.Add().Field("ID").Title("ID").Width("100px;");
columns.Add().Field("Room").Title("Room").Width("100px;");
columns.Add().Field("Inst").Title("Inst").Width("100px;");
columns.Add().Field("MKey").Title("MKey").Width("100px");
})
.HtmlAttributes(new { @class = "FontSmall" })
.Height(400)
.DataSource(source => source
.Custom()
.Transport(transport => transport
.Read(read =>
{
read.Action("MainSched_Read", "Home");
})))
.Events(events => events.Change("MainSched_Change").DataBound("MainSchedDataBound"))
)
hi,
I am following the example and the documentation, but I can't solve thi issue
Uncaught TypeError: Cannot read property 'slice' of undefined
at init.success (kendo.all.js:7083)
at success (kendo.all.js:7010)
at Object.n.success (kendo.all.js:5934)
at fire (jquery.js:3182)
at Object.fireWith [as resolveWith] (jquery.js:3312)
at done (jquery.js:8754)
at XMLHttpRequest.<anonymous> (jquery.js:9120)
my view:
<div class="row">
<form asp-controller="Home" asp-action="SetLanguage" role="search" method="post">
<div class="form-group">
@*<input type="text" placeholder="Search for something..." />*@
@(Html.Kendo().MultiColumnComboBox()
.Name("products")
.DataTextField("Name")
.DataValueField("Id")
.Columns(columns =>
{
//columns.Add().Field("Name").Template("<a href= '" + "Instrument/Quotes/#: Id #" + "'>Q</a>").Title("Name");
//columns.Add().Field("Id").Title("ID");
columns.Add().Field("Id").Template("<a href= '" + "/Analisys/AnalisysShort/#: Id #" + "'>#: Name#</a>").Title("ID");
})
.Placeholder("Search...")
.DataSource(source =>
{
source.Custom()
.ServerFiltering(true)
.ServerPaging(true)
.PageSize(80)
.Type("aspnetmvc-ajax")
.Transport(transport =>
{
transport.Read("SearchInstruments_Read", "Home");
})
.Schema(schema =>
{
schema.Data("Data")
.Total("Total");
});
})
.Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper")))
<button type="submit" class="btn btn-success">
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
</form>
</div>
<script>
function valueMapper(options) {
$.ajax({
url: "@Url.Action("SearchInstruments_ValueMapper", "Home")",
data: convertValues(options.value),
success: function (data) {
options.success(data);
}
});
}
function convertValues(value) {
var data = {};
value = $.isArray(value) ? value : [value];
for (var idx = 0; idx < value.length; idx++) {
data["values[" + idx + "]"] = value[idx];
}
return data;
}
</script>
my controller
public async Task<ActionResult> SearchInstruments_Read([DataSourceRequest] DataSourceRequest request)
{
var model = await _repo.GetAllAsync<Instrument>();
var vmodel = Mapper.Map<IEnumerable<InstrumentViewModel>>(model);
return Json(vmodel);
}
public async Task<IActionResult> SearchInstruments_ValueMapper(int[] values)
{
var indices = new List<int>();
if (values != null && values.Any())
{
var index = 0;
foreach (var model in await _repo.GetAllAsync<Instrument>())
{
if (values.Contains(model.Id))
{
indices.Add(index);
}
index += 1;
}
}
return Json(indices);
}
thank you for help