Skip to content

amuntasim/jquery-checkbox-dependency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

jquery-checkbox-dependency

jQuery plugin that resolves checkbox dependency based on a predefined map(dependency dictionary)

Usage

use dependency-group attribute in your check boxes.

You have to have a dependency dictionary.

for example:

you have a check box foo and your requirement is to check foo it must have other two check boxes (ids are 'bar', 'dum') checked. To achieve that you will have have the following check boxes.

 <input type="checkbox" id="bar"> Bar
 <input type="checkbox" id="dum"> Dum
 <input type="checkbox" id="foo" dependency-group="foo"> Foo

JS

$(function () {
  
  
  $('.permission_group_roles').chkDependencyResolver({
  rolesGroupDependencyMap: {"foo":["bar,dum"]},
  notifySelected: function (ids) {
    //render message
  },
  
  notifyDeselected: function (ids) {
    //render message
  },
  notSelector: '[dependency-group=front_desk]'
  })
}); 

About

jQuery plugin that resolves checkbox dependency based on a predefined map(dependency dictionary)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published