Project

General

Profile

Actions

Activity #2556

closed

Feature #3752: Design of the web framework for Data Centre Software

Feature #1850: Design and Development for web based ANRS

Module #2148: Developement for Configuration screens

Activity #2459: Development for UI mission deployments

Develop code to populate dropdowns

Added by Thara S Pillai about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
05/15/2024
Due date:
05/17/2024
% Done:

100%

Estimated time:
Planned Due Date:

Description

  • Create a javascript file under utils folder with the following:
var loadComboWithJSONArray = function(comboId,jsonObj,key,val,checkboolean)
    {
        var add = true;
        $('#'+comboId).empty();
        $('#'+comboId).append('<option value="0">--Select--</option>');
        $.each(jsonObj,function(idx,ob){
            add = true;
            if(checkboolean !=null)
                {
             if(checkboolean(ob))
                 $('#'+comboId).append('<option value="'+ob[key]+'">'+ob[val]+'</option>');
             else
                 $('#'+comboId).append('<option style="color:red;" disabled value="'+ob[key]+'">'+ob[val]+'</option>');
                }
            else
                $('#'+comboId).append('<option value="'+ob[key]+'">'+ob[val]+'</option>');
        });
    };
  • Include js in data capture forms to populate drop downs.
Actions

Also available in: Atom PDF