github.com/keysonZZZ/kmg@v0.0.0-20151121023212-05317bfd7d39/kmgView/kmgBootstrap/tplSelect.gotplhtml (about) 1 <? package kmgBootstrap 2 func tplSelect(config Select) string { ?> 3 <select class="form-control" <? if config.ReadOnly { ?> disabled="true" <? } else { ?> name="<?= config.Name ?>" <? } ?> > 4 <? for _, opt := range config.OptionList { ?> 5 <option value="<?= opt.Value ?>" <? if opt.Value == config.Value { ?> selected <? } ?> <? if opt.Disable { ?> disabled style="color:#ccc;background: #fff" <? } ?> > 6 <?= opt.ShowName ?> 7 </option> 8 <? } ?> 9 </select> 10 <? if config.ReadOnly { ?> 11 <input type="hidden" name="<?= config.Name ?>" value="<?= config.Value ?>"> 12 <? } ?> 13 <? } ?>