Kuika's Table element allows you to display data in your application in a table layout in an organized and understandable way. Users can examine and manage different data sets through rows and columns on the table. The Table element is especially used for data lists, reports, or in situations where information needs to be presented to the user. In this course, you will learn how to use the Table element, how to structure your data, and how to customize table layouts.
This training content consists of the following topics:
Table element is a data repeater element. The elements you add to the columns in the first row of the element will repeat in the following rows depending on the data source. After selecting the data source, you can connect to other elements in the row/column by selecting the fields in the related data table. You can give role-based authorizations to the element and set its visibility with show/hide/conditional options.
The “Sorter” property of the Table element allows you to sort the data in the table according to a specific sorting criteria (such as A to Z). This property helps you to display the table in ascending or descending order. Here are the general functions of the Sorter feature:
To use the Sorter feature of the Table element:
If you reopen a table that you have previously filtered or hidden its columns, it will automatically return with the previous settings. This feature improves your user experience and increases your productivity. It also allows you to create custom table configurations based on department. In this tutorial, you will learn how to save your previous filter and hide settings and how to restore them. This way, you can work seamlessly with previous edits of your table and easily make adjustments to suit your specific needs.
Suppose you type the word you want to search for in the first column of the table and filter it.
In this case, the current state of the table, that is, the applied filters and column settings, is exported as a string in JSON format via the “Export Table Config” action and this data is saved in the “Tables” field in the Managed DB panel.
For example, you created a data table named “TableConfig” and added “Id” and “Json” columns to it. During the “Export” operation, the table JSON data is saved in this table.
When you open the table again or click on the “Import” button, this previously saved configuration is reapplied to the table. It loads the table with the saved filters and column settings.
Once these steps are complete, when you open the table again, it will automatically load with the last saved filter and column settings. This eliminates the need to readjust the table each time.
Kuika's Export Table Configs action, specific to the Table element, allows you to export your table data. You can specify in which format you want to export your data. In this training content, you will learn how to add the Export Table Configs action to the Table element.
This training content consists of the following topics:
3. Select “on Config Change>Export>Export Table Configs” from the “+ADD ACTION” drop-down menu.
Kuika's Import Table Configs action, specific to the Table element, allows you to import your table data from files such as Excel or CSV into your application. You can quickly and efficiently connect data sets to the table element used in the application. In this tutorial, you will learn how to add the Import Table Configs action to the Table element.
This training content consists of the following topics:
3. Select “on Config Change>Export>Import Table Configs” from the “+ADD ACTION” drop-down menu.
Kuika's Reset Table Configs action, specific to the Table element, allows you to delete all configuration settings applied to the table. It resets custom settings, filtering, sort orders, column configurations and all other personalized settings made on the table. In this tutorial, you will learn how to add the Reset Table Configs action to the Table element.
This training content consists of the following topics:
3. Select “on Config Change > Export > Reset Table Configs” from the “+ ADD ACTION” drop-down menu.
4. You can select the table from the “Select a Table” field to delete all previously made configuration settings.
You can give a color change effect as hover on the rows of the Table element you use on list screens.
Select the Table element you want to add hover property to. Click row Hover Bg Color in the Properties panel.
Set the Hover color via color in the panel that opens.
You can follow the steps below to use the Master-Detail feature:
5. Datasource olarak, oluşturduğunuz Action Result'ı seçin.
6. Detail için kullanacağınız Table elementini seçin.
When you complete all the steps, your Master-Detail table will be ready for use.
Kuika Platform and SQL Support
Unfortunately, Kuika Platform does not support Master-Detail directly with SQL. However, you can review the example below to manage this process with SQL queries.
using Newtonsoft.Json;using RestSharp;
using System;
using System.Collections.Generic;
using System.Data;
using Microsoft.Data.SqlClient;
using System.Linq;
using Kuika.Common.Helpers;
using Kuika.Common.Settings; //Usingleri to add to the list.
using Kuika.Common.Classes;
using Kuika.Common.Accessors;
namespace Kuika.ThirdPartyApisCollection
{
public class myClass
{
public static List<myList> returnSQLList(string connectionString /*
The connectionString parameter given as a quika string parameter
automatically detects and fills */) //Root class as data set
we return it as List to be able to identify it.
{
List<myList> myListObj = new List<myList>(); //Class below
We create the object structure according to the definitions.
string getMasterCommand = @“SELECT * FROM MasterTable”; //Master
We are creating our SQL query where we will pull our data.
var masterResult = KPersister.Fetch(connectionString,
getMasterCommand, null); //Kuika's own SQL Query execution function
The value sent as null is the parameters in the query.
foreach (var masterObject in masterResult.ResultList) //Master
we loop the result of our query.
{
myList newObj = new myList();
newObj.objectName =
masterObject.GetValueByFieldName(“ObjectName”).ToString();
//GetValueByFieldName function to get the columns from the action result
reads. Column name is specified in double quotes.
When pulling the //Detail table, the ID of the object in the Master table
we need to use it as a parameter.
In order to use the //Parameter, again Kuika has created
we get help from the kSqlParameter Class.
var prms = new List<kSqlParameter>() {new kSqlParameter() {
Name = “masterId”,
Value =
masterObject.GetValueByFieldName(“Id”).ToString()
}
};
string getDetailCommand = @"SELECT * FROM DetailTable WHERE
masterId = @masterId”; //We are going to pull our detail data from our SQL query
we create
var detailResult = KPersister.Fetch(connectionString,
getDetailCommand, prms.ToArray()); //Run Kuika's own SQL Query
function. Set the prms variable we defined above to
We use it together with the ToArray() function.
newObj.nestedList = new List<myNestedList>(); //Nested object
an empty nested object list in our master object in order to define an empty nested object list.
we create it.
foreach (var detailObject in detailResult.ResultList) //Query
We create a new loop to process the data returned as a result.
{
myNestedList nestedListObj = new myNestedList(); //Loop
an object by using the appropriate Class to collect the data in it.
we create
nestedListObj.test1 =
detailObject.GetValueByFieldName(“Data1”).ToString(); //Parameters of the object
We match the columns and data returned as a result of the query.
nestedListObj.test2 =
detailObject.GetValueByFieldName(“Data2”).ToString();
nestedListObj.test3 =
detailObject.GetValueByFieldName(“Data3”).ToString();
newObj.nestedList.Add(nestedListObj); //We created
add the nested object to the parameter list of the master object.
}
myListObj.Add(newObj); //Root the master object we created
add it to our list.
}
return myListObj; //Return the Class Object we created.}
}
public class myList //Root Class
{
public string objectName { get; set; }
public List<myNestedList> nestedList { get; set; } //Nested objects
specified as Nested Class list to keep.
}
public class myNestedList //Nested Objects Class
{
public string test1 { get; set; }
public string test2 { get; set; }
public string test3 { get; set; }
}
}
Master-Detail Example Using Custom C#
You can also manage Master-Detail tables through Classes on Custom C# side. An example visual about this is presented below.
using Newtonsoft.Json;
using RestSharp
using System;
using System.Collections.Generic;
using System.Data;
using Microsoft.Data.SqlClient;
using System.Linq;
using Kuika.Common.Helpers;
using Kuika.Common.Settings;
namespace Kuika.ThirdPartyApisCollection
{
public class myClass
{
public static List<myList> returnMyList() //Root class data set
to be able to identify it as List.
{
List<myList> myListObj = new List<myList>(); //Class below
We create the object structure according to the definitions.
myList myListItem = new myList();myListItem.objectName = “testObj1”;
List<myNestedList> nestedListObj = new List<myNestedList>();
myNestedList nestedListItem = new myNestedList();
nestedListItem.test1 = “a”;
nestedListItem.test2 = “b”;
nestedListItem.test3 = “c”;
myNestedList nestedListItem2 = new myNestedList();
nestedListItem2.test1 = “d”;
nestedListItem2.test2 = “e”;
nestedListItem2.test3 = “f”;
myNestedList nestedListItem3 = new myNestedList();
nestedListItem3.test1 = “g”;
nestedListItem3.test2 = “h”;
nestedListItem3.test3 = “i”;
nestedListObj.Add(nestedListItem);
nestedListObj.Add(nestedListItem2);
nestedListObj.Add(nestedListItem3);
myListItem.nestedList = nestedListObj;
myListObj.Add(myListItem);
myList myListItem2 = new myList();
myListItem2.objectName = “testObj2”;
List<myNestedList> nestedListObj2 = new List<myNestedList>();
nestedListObj2.Add(nestedListItem);
nestedListObj2.Add(nestedListItem2);
nestedListObj2.Add(nestedListItem3);
myListItem2.nestedList = nestedListObj2;
myListObj.Add(myListItem2);Unset
myList myListItem3 = new myList();
myListItem3.objectName = “testObj3”;
List<myNestedList> nestedListObj3 = new List<myNestedList>();
nestedListObj3.Add(nestedListItem);
nestedListObj3.Add(nestedListItem2);
nestedListObj3.Add(nestedListItem3);
myListItem3.nestedList = nestedListObj3;
myListObj.Add(myListItem3); // Up to this point Class
We have defined the object we created over the object, its parameters.
return myListObj; //Return the Class Object we created.
}
}
public class myList //Root Class
{
public string objectName { get; set; }
public List<myNestedList> nestedList { get; set; } //Nested objects
specified as Nested Class list to keep.
}
public class myNestedList //Nested Objects Class
{
public string test1 { get; set; }
public string test2 { get; set; }
public string test3 { get; set; }
}
}
To configure the setting:
By customizing your elements with the Styling Panel, you can create impressive interfaces for your web and mobile applications. In this section, you can configure the following settings:
By following these steps, you can configure the Area Chart element to suit your needs.
Kuika supports the following system actions: