KanbanFeatures.cshtml
@(Html.EJ().Kanban("Kanban")
…………………..
.AllowFiltering(true) // Enabled filtering
.CustomToolbarItems(tool =>
{
tool.Template("#DynamicFilter").Add(); // template to render custom toolbar items
})
.ClientSideEvents(eve => eve.ActionComplete("complete")) // Action Complete event
)
|
KanbanFeatures.cshtml
<script>
var ddlData = ["equal", "notequal"];
function complete(args) {
$('#operator').ejDropDownList({// Created dropdown list for operator
dataSource: ddlData,
width: "150px",
watermarkText: "Operators",
fields: { text: "text", value: "text" }
});
$('#fieldName').ejMaskEdit({ inputMode: ej.InputMode.Text, watermarkText: "Field Name"}); // Created input text box
$('#value').ejMaskEdit({ inputMode: ej.InputMode.Text, watermarkText: "Value"});// Created input text box
$('#button').ejButton({ click: onClick, width: "100px" });// Created button
$('#clear').ejButton({ click: clear, width: "100px"});
}
function onClick(args) { // This event triggered when filter button click
var kanbanObj = $("#Kanban").data("ejKanban"), kbnQuery = ej.Query();
var queryField = $("#fieldName").val(), queryOperator = $("#operator").val(), queryValue = $("#value").val();// Get input values
if (kbnQuery.queries.length > 0 && !ej.isNullOrUndefined(kbnQuery.queries[0].e.predicates))
kbnQuery.queries[0].e.predicates.push(new ej.Predicate(queryField, queryOperator, queryValue, true));
else {
var predicates = [];
predicates.push(new ej.Predicate(queryField, queryOperator, queryValue, true)); // Created ej.Predicate
kbnQuery.where(ej.Predicate["and"](predicates)) // Add where query
}
kanbanObj.KanbanFilter.filterCards(kbnQuery) // Passed query into filterCards public method
}
function clear() { // This event triggered when clear button click
var kanbanObj = $("#Kanban").data("ejKanban");
$("#fieldName").val("");
$("#value").val("");
$("#operator").ejDropDownList({text: ""});
kanbanObj.KanbanFilter.clearFilter();// Clear filter
}
</script>
<script id="DynamicFilter" type="text/x-jsrender"> // Custom tool bar template
<table>
<td><label class="custom">Custom Filter:</label></td>
<td><input type="text" id="fieldName" /></td>
<td><input type="text" id="operator" /></td>
<td><input type="text" id="value" /></td><td> </td>
<td><button type="button" id="button">Filter</button></td>
<td><button type="button" id="clear">Clear</button></td>
</table>
</script> |
Hello Buvana,
Thank you for your advice and give me this opportunity to explain my issue.
In the Query #1 case, the card item object have 3 properties need to display.
Please refer to the attached file KanbanInline01.png, this is the default mode and the card is not be expanded.
And when expand the card, it become the Inline edit mode.
Please refer to the attached file KanbanInline02.png, the title use input type text, and the discription use textarea.
The reason why I want the expand icon which toggles the edit mode is because the properties of the card are are too little.
The checkbox display "isblock" property, and this function will not be affected by the card is expanded or not.
When I select the checkbox, then the card will be block and it can't be dragged and expanded, like the attached file KanbanInline03.png.
The whole layout of this case please refer to the attached file KanbanInlineLayout.png.
Thanks a lot and the Query#2 is very helpful.
Looking forward to your reply.
Best regards.
------------------------------------------------------------------
Hello Buvana,
Thanks your reply about the inline edit.
I have been research kanban these days, and I have some new issues.
------------------------------------
Query of SwimlaneSettings:
.SwimlaneSettings(swimSettings =>
{
swimSettings.AllowDragAndDrop(true);
})
I found it must have more than one columns and will worked.
------------------------------------
Query of EditSettings:
.EditItems(e =>
{
//@
e.Field("Demo").EditType(KanbanEditingType.Dropdown).Add();
//@
}).EditMode(KanbanEditMode.Dialog);
If this kanban ave no card, when I add a new one the Dropdown menu just have one option.
------------------------------------
Query of hide card class when edit:
The EditItems must include same class like the datasource, but I want hide some property.
For example, hide the Fields setting of PrimaryKey.
I can use the Fields setting of Title to display the card name.
So the PrimaryKey is not necessary to be shown either in EditDialog or AddDialog.
------------------------------------
Thanks a lot and looking forward to your reply.
Best regards.