The Kanban Board

Example of a kanban board

This is the table component mode

Allows you to display data in the form of a Kanban Board with a division by status and the ability to transfer the card to another status. 

To display the Kanban Board, you must do the following: 
  1. Create a status table with the columns id (PK),name, and color. These are the statuses of elements displayed at the top of the Kanban Board. 
  2. In the second GetItems request, select the statuses
    CREATE TABLE dbo.#result (id int, name nvarchar(256), color nvarchar(64))
    declare @filterName nvarchar(128)
    select @filterName = Value from @filters where [Key] = 'name'
    insert into #result
    SELECT [id],
    FROM [demo].[dbo].[as_en_statuses] -- take statuses
    WHERE entityID in (select id from as_en_entities where code='order')
    ORDER BY ord
  3. In the third select in GetItems specify the output type viewType='kanban'
  4. In the fourth select, in GetItems (instead of footer data), we output data from Kanban cards (with exactly this data model). 
           as_en_entityInstances.statusID,-- The status of element is displayed in the middle of the card
           customerName name, customerContact text, -- If the form code is specified, then
           'Comment of the customer: ' + customerComment tooltip, -- it will be a reference to the modal form
           convert(nvarchar, ord_orders.created, 120) bottomText, '' customClass--css class
    FROM ord_orders
    INNER JOIN as_en_entityInstances on = ord_orders.instanceID
  5. Additionally the following parameters can be configured in the 3 select query: 
    1. kanbanItemForm-form code. If specified, the form will be called when clicking on the Board card in the modal window
      (the form with the specified code will need to be implemented separately, Itemid=ID of the entity from the 4 select
      query is passed to it). You can also pass this parameter (kanbanItemForm -) in 4 requests for each card separately,
      to output different forms for different cards. 
    2. kanbanItemFormTitle-title of the form dialog box. 
  6. To change the status, you must implement the updateField update method for the table. The transmitted field is set hard-statusID.  
CREATE PROCEDURE [dbo].[crud_kanbanOrders_updateField]
	@itemID int,
	@field nvarchar(64),
	@value nvarchar(max),
	@username nvarchar(64)

if(@field = 'statusID') begin
   update as_en_entityInstances
   set statusID = cast(@value as int)
   where id in (select instanceID from ord_orders where id = @itemID)

end else if(@field = 'YYY') begin
    update as_trace set code = @value
    where id = @itemID

end else begin
    select 'Invalid property code' Msg, 0 Result

select '' Msg, 1 Result