0

Checkbox and data-toggle

asked 2016-08-25 08:41:47 +0800

vsansone gravatar image vsansone
1 1

updated 2016-08-26 15:02:54 +0800

Hi,

I tried to view a checkbox like Bootstrap Toggle, but I did not succeed.

I include the css and js file :

<script src="/js/bootstrap2-toggle.min.js"></script>
...
<style src="/css/bootstrap2-toggle.min.css"></style>

and declare checbox like that:

<checkbox data-toggle="toggle" value="@save(...)" disabled="@load(...)"/>

but in browser a view simple box.

How I Can view checbox like bootstrap toggle? Can I reuse bootstrap's definition or Have I to rewrite css and js file?

delete flag offensive retag edit

Comments

Check the zk8 datahandler out. Easy way tot integratie 3th party javascript

chillworld ( 2016-08-27 04:56:18 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-08-28 17:14:05 +0800

Darksu gravatar image Darksu
1991 1 4

Hello vsansone,

Also check out the small talk by Robert Wenzel for more ideas

https://www.zkoss.org/wiki/SmallTalks/2016/April/ZK8WizardExample-Part4final#CustomCheckbox_Mold

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2016-09-07 13:27:16 +0800

vsansone gravatar image vsansone
1 1

HI Darksu,

I see your link and I tried to Custom Checkbox Mold.

I define checkbox like this:

 <checkbox mold="provaMold"></checkbox>

and define the file js:

function (out) {
    var uuid = this.uuid, content = this.domContent_();
    out.push(
             '<input type="checkbox" id="', uuid, '-real"', ' data-toggle="toggle" ', this.contentAttrs_(),'/>',
             content);
}

and include file css and js:

 <script type="text/javascript" src="/js/bootstrap-toggle.min.js"></script>
 <style src="/css/bootstrap-toggle.min.css" ></style>

but I see checkbox always like a simple box.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-08-25 08:41:47 +0800

Seen: 50 times

Last updated: Sep 07 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More