In lot of applications we need multi-level category management. In this example I have created an interface to manage multi-level categories. In this interface you can manage, up to which level you would allow an user to add sub-categories. You have to supply the “maxLevel” in the getCategory() function. If you don’t supply this value then it will go up to 10th level.
Another feature of this interface is the select box. The options in this select box maintain a left-padding for each level down. By this way they are grouped under their parent. This is visually appealing and easy to use.
The fields of the form will be needed in case of making the application SEO compatible. The slug is needed as the URL Key. You have to make this slug unique. So placing some AJAX in the form would validate if it is available or not.
Download Source Code of Part 1