DHTMLX 修改方法加參數

來源:互聯網
上載者:User

標籤:dht   下拉框   com   ast   修改   顯示不全   checked   this   amp   

dhtmlx下拉框選項過長,導致顯示不全,所以在下拉框裡加了title

具體方法如下:

dhtmlXCombo.prototype.modes.checkbox.render=function(c, e) {
if(this.image_css_regexp == null) {
this.image_css_regexp = new RegExp(this.image_css.replace("#state#", "\\d*"))
}
c._conf = {
value: e.value,
css: "",
checked: window.dhx4.s2b(e.checked)
};
c.className = "dhxcombo_option";
var a = {};
if(e.multicol == true) {
e.text.checkbox = "<div class=‘" + String(this.image_css).replace("#state#", (c._conf.checked ? "1" : "0")) + "‘></div>&nbsp;";
a.checkbox = true;
c.innerHTML = "<div class=‘" + dhtmlXCombo.prototype.modes.option.option_css + "‘ title=‘"+ e.text + "‘></div>"
} else {
c.innerHTML = "<div class=‘" + String(this.image_css).replace("#state#", (c._conf.checked ? "1" : "0")) + "‘></div><div class=‘" + this.option_css + "‘ title=‘"+ e.text + "‘>&nbsp;</div>"
}
if(e.css != null) {
c.lastChild.style.cssText += e.css;
c._conf.css = e.css
}
this.setText(c, e.text, a);
return this
};

dhtmlXCombo.prototype.modes.option.render=function(a, c) {
a._conf = {
value: c.value,
css: ""
};
a.className = "dhxcombo_option";
a.innerHTML = "<div class=‘" + this.option_css + "‘ title=‘"+ c.text + "‘ >&nbsp;</div>";
if(c.css != null) {
a.lastChild.style.cssText = c.css;
a._conf.css = c.css
}
this.setText(a, c.text);
return this
}

 

 

編譯出來的HTML代碼加入的div裡加入title屬性

a.innerHTML = "<div class=‘" + this.option_css + "‘ title=‘"+ c.text + "‘ >&nbsp;</div>";

DHTMLX 修改方法加參數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.