2014年4月26日 星期六

Call a Function after Previous Function is Complete

http://jsfiddle.net/GkUEN/14/      good http://recurial.com/programming/understanding-callback-

http://www.impressivewebs.com/callback-functions-javascript/
functions-in-javascript/

function Typer(callback)
{
    var srcText = 'EXAMPLE ';
    var i = 0;
    var result = srcText[i];
    var interval = setInterval(function() {
        if(i == srcText.length - 1) {
            clearInterval(interval);
            callback();
            return;
        }
        i++;
        result += srcText[i].replace("\n", "<br />");
        $("#message").html(result);
    },
    100);
    return true;
     
 
}

function playBGM () {
    alert("Play BGM function");
    $('#bgm').get(0).play();
}

Typer(function () { playBGM();});


















refer : http://stackoverflow.com/questions/14007696/how-to-match-columns-in-a-scrolling-table-with-fixed-headers

$('a.button').click(function(){
    if (condition == 'true'){
        function1(someVariable, function() {
          function2(someOtherVariable);
        });
    }
    else {
        doThis(someVariable);
    }
});


function function1(param, callback) {
  ...do stuff
  callback();
} 

2014年4月25日 星期五

javascript-array jquery-each jquery-table


javascript-array
jquery-each-this
jquery-table-control

var textAligns = new Array();
var widths = new Array();
r=0
$('#maintable > tbody  > tr:first-child >td').each(function() {
textAligns[r]=$(this).css('textAlign');
widths[r++]=$(this).width();
});
r=0
$('#maintable > thead  > tr:first-child >th').each(function() {
$(this).css(textAligns[r]);
$(this).width(widths[r++]);
});

2014年4月24日 星期四

generator-where-constrain


where=where SOHSTA:`A` AND SOqty>poqty  and SUPPLIER like `^'+parent.currentEntity+'^` and SOP_CUR like `^'+parent.currentCurrency+'^` and FIND_IN_SET(TRIM(SODP_RecordID),"'+parent.currentChoose+'"):0 AND CONFIRM:1   and PVIA like `^'+parent.currentVIA+'^` and  IF(`'+parent.currentVIA2+'`:`X`,PVIA<>` `,TRUE)


where=where status:`D` and PARENT_RECORDID : '+parent.RECORDID+'

#where=where SOqty>poqty  and SUPPLIER like `^'+parent.currentEntity+'^` and FIND_IN_SET(TRIM(SODP_RecordID),"'+parent.currentChoose+'"):0



where=where SOqty>poqty  and SUPPLIER like `^'+parent.currentEntity+'^` and FIND_IN_SET(TRIM(SODP_RecordID),"'+parent.currentChoose+'"):0

generator-onclick

onclick="
$('#popup-wrapper').width(<%=appendData0ModalWidth%>).height(<%=appendData0ModalHeight%>);$('#moralFrame').prop('src','input.jsp?mode=LIST&input=messageList.txt&config=messageListConfig.txt');
$('#clicker').click();"

2014年4月22日 星期二

java-array

String [] pageColWidth=new String [10];
for (int i = 0 ; pageColWidth.length<i; i++)
{
pageColWidth[i]="";
}

String [] GridStyle={"General","Detail","Detail","Detail","Detail","Detail","Detail","Detail","Detail","Detail"};
String [] PageHeaderCaption={"General","Detail"};


  1. public int[] methode() {  
  2.     int[] a = {1,2,3,4,5};  
  3.     return a;   
  4. }  


selector.addFont(consoles);



int printChinese=0;

String s0c="法,字,蝶,金,中,版,電,惱,人,載,網,站,軟,體,檔,案,系,統,數,據,資,料";
String as0c[]=s0c.split(","); 
for (int i0c=0; i0c<as0c.length; i0c++){
if (printLine.indexOf(as0c[i0c])>=0){printChinese=1;}
}

2014年4月21日 星期一

asp-excel (numeric to string, formula)

<TD>="0001"</TD>
      <TD>The Perfect Programming Book</TD>
      <TD>13.00</TD>
      <TD>5.00</TD>
      <TD>8.25%</TD>
      <TD>=Sum(c2:d2)*(1+E2)</TD>

2014年4月15日 星期二

html-table-freeze

http://stackoverflow.com/questions/1312236/how-do-i-create-an-html-table-with-fixed-frozen-left-column-and-scrollable-body


        body { font:16px Calibri;}
        table { border-collapse:separate; border-top: 3px solid grey; }
        td {
            margin:0;
            border:3px solid grey;
            border-top-width:0px;
            white-space:nowrap;
        }
        div {
            width: 600px;
            overflow-x:scroll;
            margin-left:5em;
            overflow-y:visible;
            padding-bottom:1px;
        }
        .headcol {
            position:absolute; 
            width:5em;
            left:0;
            top:auto;
            border-right: 0px none black;
            border-top-width:3px; /*only relevant for first row*/
            margin-top:-3px; /*compensate for top border*/
        }
        .headcol:before {content: 'Row ';}
        .long { background:yellow; letter-spacing:1em; }