It is my Computer Notes. Using Guide : object-key or object-key-key e.g. Step 1 Blog Search : [mysql-run] and then Step 2 ctrl+F [mysql-run] {bookMark me : Ctrl+D}
2014年8月27日 星期三
How do I prevent a click handler being triggered when a child element is clicked?
http://stackoverflow.com/questions/6203042/how-do-i-prevent-a-click-handler-being-triggered-when-a-child-element-is-clicked
http://jsfiddle.net/ArondeParon/emLhv/
2014年8月12日 星期二
href target
<!DOCTYPE html>
<html>
<head>
<style>
:target
{
border: 2px solid #D4D4D4;
background-color: #e5eecc;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p><a href="#news1">Jump to New content 1</a></p>
<p><a href="#news2">Jump to New content 2</a></p>
<p>Click on the links above and the :target selector highlight the current active HTML anchor.</p>
<p id="news1"><b>New content 1...</b></p>
<p id="news2"><b>New content 2...</b></p>
<p><b>Note:</b> Internet Explorer 8 and earlier versions do not support the :target selector.</p>
</body>
</html>
<html>
<head>
<style>
:target
{
border: 2px solid #D4D4D4;
background-color: #e5eecc;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p><a href="#news1">Jump to New content 1</a></p>
<p><a href="#news2">Jump to New content 2</a></p>
<p>Click on the links above and the :target selector highlight the current active HTML anchor.</p>
<p id="news1"><b>New content 1...</b></p>
<p id="news2"><b>New content 2...</b></p>
<p><b>Note:</b> Internet Explorer 8 and earlier versions do not support the :target selector.</p>
</body>
</html>
2014年8月11日 星期一
html check box update when unchecked
http://stackoverflow.com/questions/1809494/post-the-checkboxes-that-are-unchecked
<input id='testName' type='checkbox' value='Yes' name='testName'>
<input id='testNameHidden' type='hidden' value='No' name='testName'>
Before submitting the form , disabled the hidden field based on the checked condition
if(document.getElementById("testName").checked){
document.getElementById('testNameHidden').disabled = true;
}
2014年8月10日 星期日
Android UI widget
(values)strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resonrces>
<string name="app_name">Widget Demo 4<string>
<string name="ui_message">Change brightness with SeekBar<string>
<string name="menu_settings">Settings<string>
</resources>
(layout)activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/llBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android::orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:bacground="#EEF7C1"
android:text="@string/ui_message"/>
<SeekBar
android:id="@+id/sbColor"
android:layout_width="match_parent"
android:layout_height="wrap_parent"
android:max="255"
android::progress="0" />
</LinearLayout>
MainActivity.java
package nn.widgetdemo4;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Menu;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.Toast;
public class MainActivity extends Activity {
private LinearLayout llBackground;
private SeekBar sbColor;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
runDemo();
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main,menu);
return true;
}
private void runDemo(){
llBackground=(LinearLayout) findViewById(R.id.llBackground);
sbColor=(SeekBar) findViewById(R.id.sbColor);
sbColor=setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){
llBackground.setBackgroundColor(
Color.rgb(progress,progress,progress));
}
@Override
public void onStopTrackingTouch(SeekBar seekBar){
String msg="Red,Green,Blue value."+seekBar.getProgress();
Toast.makeText(MainActivity.this,msg,Toast.LENGTH_SHORT).show();
}
@Override
public void onStartTrackingTouch(SeekBar seekBar){
//
}
})
}
}
<?xml version="1.0" encoding="utf-8"?>
<resonrces>
<string name="app_name">Widget Demo 4<string>
<string name="ui_message">Change brightness with SeekBar<string>
<string name="menu_settings">Settings<string>
</resources>
(layout)activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/llBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android::orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:bacground="#EEF7C1"
android:text="@string/ui_message"/>
<SeekBar
android:id="@+id/sbColor"
android:layout_width="match_parent"
android:layout_height="wrap_parent"
android:max="255"
android::progress="0" />
</LinearLayout>
MainActivity.java
package nn.widgetdemo4;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Menu;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.Toast;
public class MainActivity extends Activity {
private LinearLayout llBackground;
private SeekBar sbColor;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
runDemo();
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main,menu);
return true;
}
private void runDemo(){
llBackground=(LinearLayout) findViewById(R.id.llBackground);
sbColor=(SeekBar) findViewById(R.id.sbColor);
sbColor=setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){
llBackground.setBackgroundColor(
Color.rgb(progress,progress,progress));
}
@Override
public void onStopTrackingTouch(SeekBar seekBar){
String msg="Red,Green,Blue value."+seekBar.getProgress();
Toast.makeText(MainActivity.this,msg,Toast.LENGTH_SHORT).show();
}
@Override
public void onStartTrackingTouch(SeekBar seekBar){
//
}
})
}
}
2014年8月1日 星期五
generator-lookupValue , generator-lookupTable
var s=lookupTable('QTY,REASON_DESCRIPTION','PURCHASE_APPLY_LINE.RECORDID',RECORDID);
_refreshv2('query.QTY',s.split(',')[0]);
_refreshv2('query.REASON_DESCRIPTION',uiDisplay(s.split(',')[1]));
/******************************************************************/
var s4='CUSTOMER_NO,PAYMENT_TERMS,TYPE,LEADTIME,REQUEST_SHIP_DATE,URGENT,TARGET_COMPLETION_DATE,QD_NO,CUSTOMER_PO_DATE,ENTRY_DATE,CUSTOMER_REQUIREMENT,EXTERNAL_SALES,INTERNAL_SALES,SIGNED_QD,SIGNED_CPO,SIGNED_SQD,END_USER,LQD_NO,PQD_NO,INTERNAL_SALES2,ISSUED_BY';
var s3=lookupTable(s4,'INBOX_HEADER.RECORDID',formResult);
var s4a=s4.split(',');
var s3a=s3.split(',');
for (i=0;i<=s4a.length;i++){
if (s3a[i]){_refreshv2('SALES_ORDER_HEAD.'+s4a[i],s3a[i].replace(/CoMmA/g,','));}
}
generator-lookup generator-findValue
{object}
0.26,SALES_ORDER_HEAD.CUSTOMER_NO,lookupValue,98%:50%:98%,15,Customer,,
{findValue}
SOURCE_TABLE=CUSTOMER,SOURCE_NAME=NAME,SOURCE_CODE=RECORDID
{/findValue}
{/object}
s1103x=_lookup('PURCHASE_HEADER.SALES_ORDER');
_refreshv2('view.uploadDocument',lookupTable('SIGNED_QD','SALES_ORDER_HEAD.SALES_ORDER',s1103x));
function lookupTable(_returnField,_tableField,_searchValue){
var _table=_tableField.split('.')[0];
var _field1103=_tableField.split('.')[1];
var r1103='';
var s1103='tableRead?table='+_table+'&fields='+_returnField
+'&where=where '+_field1103+': %60'+_searchValue +'%60&format=S&callback=?&db='+DATABASE;
$.getJSON(s1103,
function(data) {
if (data[0]){
r1103=data[0][0];
}
}
)
return r1103;
}
訂閱:
文章 (Atom)