2014-08-27 50 views
0

在我的應用程序創建一個使用D3功能的幾個按鈕,但是當他們顯示他們沒有圓形邊框像硬編碼按鈕的功能:jQuery Mobile的方/圓造型

「菜單」難編碼,其他四個按鈕是從D3的功能 enter image description here

我首先想到我已經搞砸了按鈕的類,但他們確實有ui-corner-all類: enter image description here

他們爲什麼不得到病急亂投醫是否正確? (有除了紅色文字應用沒有自定義CSS) 他們應該沿着這些例子的線條看起來: http://demos.jquerymobile.com/1.4.2/checkboxradio-radio/

編輯: 這裏的D3功能:

this.initialLoad = function(){ 
     //var data= ["First button with some long text in the descriptionnnnnnnnnnnnnnnnnnnnnnnnnnnn", "Second button with some long text in the description"]; 

     console.log("initialLoad"); 
     //Create the header 
     headerElem = d3.select("#uploadedCompany") 
     .append("p"); 
     //add the required buttons for selecting the right sheet for the set 
     var Addedbuttons = d3.select("#TheButtons").selectAll("input") 
      .data(
          function(){ 
       var titlelist = Array(); 
       for (var n = 0; n < numOfSheets; n++){ 
        titlelist[n]= upLoadedData[n].title; 
       } 
       return titlelist; 
      } 
        ) 
      .enter() 
      .append('label') 
      .attr('for',function(d,i){ return 'Statement_a'+i; }) 
      .text(function(d) { return d; }) 
      .append("input")  
      .attr("type", "radio") 
      .attr("name","stmntRadio") 
      .property('checked',function (d,i){if (i===pSI) return true; else return    `false;})` 
      .attr("id", function(d,i) { return i; }) 
      .attr("onClick", "rbStatementClicked(this)"); 

     //make sure that the trendON is false 
     d3.select("#cbTrendOn").node().checked = false;   
     updateSheet(); 
        $("#TheButtons").enhanceWithin(); 
    }; 
+0

我們展示您的代碼創建的按鈕或創建重現這一問題的小提琴。如果你願意,你可以編輯和更新這個小提琴:http://jsfiddle.net/ezanker/7fnzubbt/ – ezanker 2014-08-27 19:17:33

+0

我不能重新創建它。所有這些結果都是循環的/與我現在所擁有的不同。 – user3413170 2014-08-27 22:24:20

回答

0

我假設你#TheButtons DOM元素設置爲data-type =「horizo​​ntal」的控制組。在這種情況下,你只需要在內部的增強之後添加.controlgroup(「刷新」)。另外,將動態控件添加到控件組中的.ui-controlgroup-controls DIV。

var Addedbuttons = d3.select("#TheButtons .ui-controlgroup-controls ").selectAll("input") 
      .data(data) 
      .enter() 
      .append("input")  
      .attr("type", "radio") 
      .attr("name","stmntRadio") 
      .attr("id", function(d,i) { return 'Statement_a'+i; }) 
      .attr("onClick", "rbStatementClicked(this)") 
      .append('label') 
      .attr('for',function(d,i){ return 'Statement_a'+i; }) 
      .text(function(d) { return d; }) 
; 

$("#TheButtons").enhanceWithin().controlgroup("refresh"); 

這裏是一個DEMO