Prioritization of cards
28 May 20193 minutes to read
Prioritizing cards is easy with drag-and-drop re-ordering that helps you to categorize most important work at the top. Cards can be categorized with priority by mapping specific database field into Priority
property.
RankId
defined in the dataSource which is consist priority of cards. The RankId
will be changed while card ordering changes through Drag and Drop
and Editing
.
The following code example describes the above behavior.
@(Html.EJ().Kanban("Kanban")
.DataSource((IEnumerable<object>)ViewBag.datasource)
.Columns(col =>
{
col.HeaderText("Backlog").Key("Open").Add();
col.HeaderText("In Progress").Key("InProgress").Add();
col.HeaderText("Done").Key("Close").Add();
})
.KeyField("Status")
.Fields(field =>
{
field.Content("Summary")
.Priority("RankId")
.PrimaryKey("Id");
})
)
namespace MVCSampleBrowser
{
public partial class KanbanController : Controller
{
//
// GET: /Kanban/
public ActionResult KanbanFeatures()
{
var DataSource = new NorthwindDataContext().Tasks.Take(30).ToList();
ViewBag.datasource = DataSource;
return View();
}
}
}
The following output is displayed as a result of the above code example.
NOTE
For Drag and Drop event handling, please refer this API.
NOTE
If the
Priority
property is not set in the Kanban fields, the cards are dropped based on the specifying JSON data orders in a particular column. If not set, drop the card in a particular position based on the previous cardPriority
value and the next card’sPriority
values will change dynamically.