顯示具有 generator 標籤的文章。 顯示所有文章
顯示具有 generator 標籤的文章。 顯示所有文章

2016年2月25日 星期四

generator-vview hview



{vView}{vViewLabel}{vViewValueStyle}
{vViewValue}{/vViewValue}
{vView}{hView}
{vViewLabel}Part No.{/vViewLabel}
{vView}
{vViewValueStyle}font-weight: bold;TEXT_IMPORTANT{/vViewValueStyle}

2015年4月9日 星期四

generator-multi-select -multiselect



http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/

http://www.erichynds.com/blog/jquery-ui-multiselect-widget


get multi select value 

var selectedValues = $('.PURCHASE_HEADER_VIEW3_FSTATUS_filter').val();

 layout.txt


{object}
0.700,INBOX_HEADER.SOLUTION_TYPE,combo,40%,100,Solution Type,,
{combo}[SOLUTIONTYPES]{/combo}
{spaceLine}
{multiSelect}
{multiple}
{/object}





import from another Table (config.txt)

var s3=lookupTable('SOLUTION_TYPE','QUOTATION_HEADER.RECORDID',formResult);
_refreshv2('hidden_INBOX_HEADER.SOLUTION_TYPE',s3);
_combo2('INBOX_HEADER.SOLUTION_TYPE',SOLUTIONTYPES,s3,'');
$('.INBOX_HEADER_SOLUTION_TYPE').multiselect('refresh');


jQuery UI MultiSelect Widget

Tuesday, July 06, 2010

This is the successor and port of my original jQuery MultiSelect Plugin to a jQuery UI widget. While both will actively be maintained, I highly recommend you use this version over the plugin version. It has a more robust feature set, is faster, and is much more flexible. MultiSelect turns an ordinary HTML select control into an elegant drop down list of checkboxes with themeroller support.
This version inherits all the benefits from the jQuery UI widget factory that are not available in the plugin version. The most requested feature was the ability to call methods on instances after initialization (e.g., statefullness), and now there are 10 to choose from! Also present are eight events you can bind to, which in the previous version, had fewer and limited support. Finally, there is support for effects. Just include the jQuery UI effects dependency and specify the name of the opening or closing effect to use (and speed, if you wish!)

Demo

See what you're missing out on? Many more demos are available here.

Usage

Using this widget is simple. First, include the following files:
  • jQuery 1.4.2+
  • jQuery UI 1.8 widget factory and effects (if you'd like to use them)
  • A jQuery UI theme
  • This widget: jquery.multiselect.js
  • The CSS file: jquery.multiselect.css
Next construct a standard multiple select box. Do not forget the multiple attribute:
<select id="example" name="example" multiple="multiple">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
</select>
Finally, initialize the widget on the select box once the document is ready:
$(document).ready(function(){
   $("#example").multiselect();
});
See the demos for advanced usages and for more documentation!

Options

To further customize multiselect, pass in a object with one or more of the options below.
// example:
$("select").multiselect({
   header: "Choose an Option!"
});
OptionDescriptionDefault
headerEither a boolean value denoting whether or not to display the header, or a string value. If you pass a string, the default "check all", "uncheck all", and "close" links will be replaced with the specified text.true
heightHeight of the checkbox container (scroll area) in pixels. If set to "auto", the height will calculate based on the number of checkboxes in the menu.175
minWidthMinimum width of the entire widget in pixels. Setting to "auto" will disable.225
checkAllTextThe text of the "check all" link.Check all
uncheckAllTextThe text of the "uncheck all" link.Uncheck All
noneSelectedTextThe default text the select box when no options have been selected.Select options
selectedTextThe text to display in the select box when options are selected (ifselectedList is false). A pound sign (#) will automatically replaced by the number of checkboxes selected. If two pound signs are present in this parameter, the second will be replaced by the total number of checkboxes available. Example: "# of # checked". This parameter also accepts an anonymous function with three arguments: the number of checkboxes checked, the total number of checkboxes, and an array of the checked checkbox DOM elements. See examples for usage.# selected
selectedListA numeric (or boolean to disable) value denoting whether or not to display the checked opens in a list, and how many. A number greater than 0 denotes the maximum number of list items to display before switching over to the selectedText parameter. A value of 0 or false is disabled.false
showThe name of the effect to use when the menu opens. To control the speed as well, pass in an array: ['slide', 500]empty string
hideThe name of the effect to use when the menu closes. To control the speed as well, pass in an array: ['explode', 500]empty string
autoOpenA boolean value denoting whether or not to automatically open the menu when the widget is initialized.false
multipleIf set to false, the widget will use radio buttons instead of checkboxes, forcing users to select only one option.true
classes
New in 1.5!
 Additional class(es) to apply to BOTH the button and menu for further customization. Separate multiple classes with a space. You'll need to scope your CSS to differentiate between the button/menu: css /* button */ .ui-multiselect.myClass {} /* menu */ .ui-multiselect-menu.myClass {}
empty string
position
New in 1.5! Requires jQuery 1.4.3+, jQuery UI position utility
 This option allows you to position the menu anywhere you'd like relative to the button; centered, above, below (default), etc. Also provides collision detection to flip the menu above the button when near the bottom of the window. If you do not set this option or if the position utility has not been included, the menu will open below the button. Requires the jQuery UIposition utility and jQuery 1.4.3+. Please see this demo for usage instructions.
empty object

Events

Hook into any of the events below by either binding to the event name, or passing in the name of the event during initialization:
// bind to event
$("#multiselect").bind("multiselectopen", function(event, ui){
    // event handler here
});

// or pass in the handler during initialization
$("#multiselect").multiselect({
    open: function(event, ui){
        // event handler here
    }
});
EventDescription
create
Requires jQuery UI Widget Factory 1.8.6+
 Fires when the widget is created for the first time.
beforeopenFires right before the menu opens. Prevent the menu from opening by returning false in the handler.
openFires after the widget opens.
beforecloseFires right before the menu closes. Prevent the menu from closing by returning false in the handler.
closeFires after the widget closes.
checkallFires when all the options are checked by either clicking the "check all" link in the header, or when the "checkall" method is programatically called (see next section).
uncheckallFires when all the options are all unchecked by either clicking the "uncheck all" link in the header, or when the "uncheckall" method is programatically called (see next section).
optgrouptoggleFires when an optgroup label is clicked on. This event receives the original event object as the first argument, and a hash of values as the second argument: js $("#multiselect").bind("multiselectoptgrouptoggle", function(event, ui){ /* event: the original event object, most likely "click" ui.inputs: an array of the checkboxes (DOM elements) inside the optgroup ui.label: the text of the optgroup ui.checked: whether or not the checkboxes were checked or unchecked in the toggle (boolean) */ });
clickFires when a checkbox is checked or unchecked. js $("#multiselect").on("multiselectclick", function(event, ui) { /* event: the original event object ui.value: value of the checkbox ui.text: text of the checkbox ui.checked: whether or not the input was checked or unchecked (boolean) */ });

Methods

After an instance has been initialized, interact with it by calling any of these methods:
// example:
$("#multiselect").multiselect("method_name");
MethodDescription
openOpens the menu.
closeCloses the menu.
refreshReloads the checkbox menu. If you're dynamically adding/removing option tags on the original select via AJAX or DOM manipulation methods, call refresh to reflect the changes in the widget.
disableDisable the entire widget.
enableEnable the entire widget.
checkAllCheck all checkboxes.
uncheckAllUncheck all checkboxes.
isOpenReturns a boolean denoting if the widget is currently open or not.
getCheckedReturns an array of all the checked checkboxes.
getButton
New in 1.13!
 Returns the button element.
widgetReturns the menu container (all checkboxes inside).
optionSet or get one of the options after the widget has been initialized. If changing an option, the new option setting will take affect immediately.
destroyDestroy the widget, and revert back to the original select box.

Filter Plugin

A filtering widget is available which, once initialized on a multiselect instance, will insert a text box inside the widget header. Typing in the input will filter rows and return matches in real time. To view a demo, download, or read the documentation, head to the demo page.

How do I...?

These questions came out of the comments which others will probably find useful:

Set default options for all multiselect instances?

The options object is located in $.ech.multiselect.prototype.options. To configure options that all new instances will inherit, it's easier to set them in this object instead of on an instance-by-instance basis.
$.ech.multiselect.prototype.options.selectedText = "# of # selected";

Retrieve all selected values?

The easiest way is to call val() on the select box:
var values = $("select").val();
The same can be accomplished using the multiselect API. Call the getChecked method and map a new array:
var array_of_checked_values = $("select").multiselect("getChecked").map(function(){
   return this.value;    
}).get();

Retrieve values on the server?

Depends on your server-side language. In PHP et. al., you may need to name your select with square brackets on the end so the values can be captured as an array. I will probably wind up implementing this as an option at some point so it'll degrade a bit better.

Prevent the selectedList option from increasing the button's height?

Open up the CSS file and edit the .ui-multiselect declaration.
.ui-multiselect { height:25px; overflow-x:hidden; padding:2px 0 2px 4px; text-align:left }
The height you'll need to set depends on the font size and padding you use, so it may need adjusting.

Manually check or uncheck a checkbox?

The checkboxes can be accessed after calling the "widget" method. Simply manually trigger the NATIVE click event on them:
// manually check (or uncheck) the third checkbox in the menu:
$("select").multiselect("widget").find(":checkbox").each(function(){
   this.click();
});
The native click event must be used (trigger('click') will not work) due to this bug in jQuery's core.
All necessary events and actions, like updating the button value, will automatically fire.
Alternatively, you could give the original option tag the selected attribute, and then call MultiSelect'srefresh method.

Show checked values on another part of my page?

Use multiselect in conjunction with the validate plugin?

Make sure you're using version 1.7 of the validation plugin; 1.6 is NOT supported with either this plugin or jQuery version 1.4.2+. Validate 1.6 defines its own "delegate" method which conflicts with the method added in jQuery. The conflict was resolved in Validate 1.7.

Issues

If you find any issues, please report them using the GitHub issue tracker. Thanks!

2015年2月3日 星期二

generator-grid-invisible-when-approve-enable -scroll-table








Config.txt
Page1TableWidth=100%
Page3TableWidth=100%
gridWidth=,1401px;,1402px;,1013px;



{layoutInvisibleWhenPROCESSING_MODE}D{/layoutInvisibleWhenPROCESSING_MODE}
{enableWhenApprove}


{object}
1.361,SUPPLIER_INVOICE_LINE.AC_CODE,text:GRID,10%,10,AC CODE,,
{dblclickSetData}FORM=codeListOnly{/dblclickSetData}  
{dblclickGetData}
SOURCE_TABLE=CODE, 
SOURCE_FIELD=CODE&ACCOUNT&RECORDID&RECORDID,
SOURCE_FORMAT=S&S&S,
TARGET_FIELD=this..AC_CODE&this..ACCOUNT&this..CODE_RECORDID
{/dblclickGetData}
{layoutInvisibleWhenPROCESSING_MODE}D{/layoutInvisibleWhenPROCESSING_MODE}
{enableWhenApprove}
{/object}


{object}
1.361,SUPPLIER_INVOICE_LINE.DESCRIPTION,textarea:GRID,20%,150,Description,,
{subformHeight}300{/subformHeight}{subformWidth}640{/subformWidth}
{whenDraftModeWidth}50{/whenDraftModeWidth}
{readonly}
{/object}




2015年1月8日 星期四

generator-choice

generator-choice


config

selectedButtonCaption=Selected


layout

{object}
0.61,SOPOQTY.CHOICE,check:GRID,3%,100,_,,
{countChecked}0{/countChecked}
{tooltip}Sales Order No.{/tooltip}
{onChange}
var s1226=($('.SOPOQTY_NAME'+thisRowNo).val());
var s0107=($('.SOPOQTY_PVIA'+thisRowNo).val());
if ((currentEntity.trim()=="" & currentVIA=="") | (currentEntity.trim()==s1226.trim()  & currentVIA.trim()==s0107.trim())){
currentEntity=s1226;
currentVIA=s0107;
} else {
document.getElementById('SOPOQTY.CHOICE'+thisRowNo).checked=false;
preventDefault();
alert('Please Check the Same Supplier !');
/*_messagebox('Please Select the Same Supplier',0,16,'Choice Message ! ');*/
return false;
}
var i=0;
$('.SOPOQTY_CHOICE').each(function (){if(this.checked){i++;}});
if(i==0){currentEntity=''}
{/onChange}
{/object}

2015年1月7日 星期三

genertor-actionAfterRefresh

use in grid
place in the last column of grid

e.g. salesorder.txt
{actionAfterRefresh}
var confirmed=document.getElementById('SALES_ORDER_PO_DESC.CONFIRM'+editRow).checked;
var s050107=_lookup('SALES_ORDER_PO_DESC.recordID'+editRow);
var s050107a=lookupTable('RECORDID','PO.SODP_RECORDID',s050107);
if (PROCESSING_MODE=='P'){
document.getElementById('SALES_ORDER_PO_DESC.CONFIRM'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.VENDOR_PRODUCT_RECORDID'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.PRICE'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.UNIT'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.CUR'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.VENDOR_PARTNO'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.MAINTAIN_MTHS'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.MAINTAIN_TYPE'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.QTY'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.DISCOUNT'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.SQD_NO'+editRow).disabled=confirmed;
}
if (PROCESSING_MODE=='D'){
if (confirmed){
$('.SALES_ORDER_PO_DESC_MAINTAIN_TYPE'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_UNIT'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_VENDOR_PRODUCT_RECORDID'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_CUR'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_PVIA'+editRow).css('pointer-events','none');
}
}
if (s050107a!=''){
$('.SALES_ORDER_PO_DESC_PVIA'+editRow).css('pointer-events','none');
}
{/actionAfterRefresh}

2014年11月23日 星期日

generator-dictionary

A
alert
if(aaaa) alert('This Company QD '+s1107+ ' have used before in :  \n\n'+aaaa+' ');

all_address_book
(Email,phone,name,recordid,parent_recordid,status)

appendData0ActionAfter


B

C

table.CreateUser

SELECT CREATEDATETIME,CREATEUSER,USER,CREATEUSERNAME FROM SALES_ORDER_HEAD WHERE CREATEUSERNAME='WINNIE';

LoginCheck.jsp
bean.setRecordid(rs.getString(3).trim());

input.jsp
-USER_RECORDID=bean.getRecordid();
-USER = bean.getAlias()+" "+bean.getLastName();

ShowParameter.java
-USER_RECORDID=_userRecordid (paramValue in ShowParameter.java)

mysql Trigger
table.CREATEUSER  <= new.USER_RECORDID

CREATEUSRRNAME
A

D
DISABLED
check disabled
if(newAdd==0){document.getElementById('SALES_ORDER_HEAD.DIVISION').disabled = true;};

A

doc_no
It can remove.
1. text. 2 config file

D
J
JAVA-Variable
a
K
L
lookupTable
lookupTable('SQD_FILE','SOPOQTY.SALES_ORDER',s1103x,'SQD_FILE<>"" and supplier='+sKey);



Reject
SaveButton3Caption=Reject
SaveButton3ClickMethod=documentAction:'R';saveAction:'Reject';_refreshv2('DNOTE_HEADER.STATUS','R');


Table
table{border-spacing:2px;border-color}


vertical-align:top



2014年11月22日 星期六

generator-example-upload generator-rename-file rename file

{object}
0.55,SALES_HEADER.SIGNED_INV,upload,40%,10,Signed INV,,
{readonly} it is effect the display !!
{spaceLine}
{onclick}s=_lookup('this..INV_NO');
if(s){s=s+'-';}
if(s){s=s+_lookup('this..VERSION');}if(!s) {;mTargetName=datetimer();} else {s=s+'_SignedINV';mTargetName=s;}{/onclick}
{folder}iv{/folder}
{rename}SALES_HEADER~SIGNED_INV~INV_NO~_SignedINV{/rename}
{renameMessage}The file name will rename to Customer Invoice{/renameMessage}
{invisibleWhen}
PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A'
{/invisibleWhen}
{enableWhenApprove}
{errMess}Please upload signed Invoice{/errMess}
{enableWhenPartial}
{/object}




---------------------------------------------------------------------------------------

{visibleWhen} <= view the  file name
PROCESSING_MODE=='P' | PROCESSING_MODE=='S' | PROCESSING_MODE=='A' | PROCESSING_MODE=='R' | PROCESSING_MODE=='a'{/visibleWhen}
--------------------------------------------------------------------------------

{invisibleWhen} <= the upload button not display
PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A'
{/invisibleWhen}


-------------------------------------------------------------

{object}
0.55,SALES_HEADER.SIGNED_INV,upload,40%,10,Signed INV,,
{onclick}s=_lookup('this..INV_NO');
if(s){s=s+'-';}
if(s){s=s+_lookup('this..VERSION');}if(!s) {;mTargetName=datetimer();} else {s=s+'_SignedINV';mTargetName=s;}{/onclick}
{folder}iv{/folder}
{rename}SALES_HEADER~SIGNED_INV~INV_NO~_SignedINV{/rename} 
{renameMessage}The file name will rename to Customer Invoice{/renameMessage}
{/object}





generator-upload

{onclick}
s=_lookup('this..SALES_ORDER');if(!s)
{;mTargetName=datetimer();} else {s=s+'_CQD';mTargetName=s;}
{/onclick}
{folder}so{/folder}
{rename}SALES_ORDER_HEAD~SIGNED_QD~SALES_ORDER~_CQD{/rename}
{renameMessage}The file name will rename to Sales Order{/renameMessage}

--------------------------------------------------------------


0.55,SALES_ORDER_HEAD.SIGNED_CPO,upload,6,10,Signed CPO,, {readonly}{42}s=_lookup('SALES_ORDER_HEAD.SALES_ORDER');if(!s) {alert('No S.O. Number, Please Save it Before Continue');mTargetName='NoContinue';} else {s=s+'_CPO';mTargetName=s;}{/42}




2014年7月24日 星期四

generator-checker generator-check

{object}0.66,GRN_HEADER.NO_GRN,check,0,0,GRN :No GRN,,
{/object}


document.getElementById('PRODUCT.ISCOMMERCIAL').checked = (s=='C');

2014年7月15日 星期二

generator-date , -date-calculate dateCalculate -default dtoc from date to date

_refreshv2('RECEIPT_HEADER.DATE',_today());


from date to date


{object}
0.30,query.GRN_SN_EXP,date,10,10,From D. Expire: Date ,,
{toolTips}Distributor Expire Date{/toolTips}
{from}
{placeHolder}yyyy-mm-dd{/placeHolder}
{default}empty{/default}
{colspan}3{/colspan}
{/object}


{object}
0.30,query.GRN_SN_EXP{to},date,10,10,To : Date ,,
{default}_today('y5'){/default}
{to}
{dependent}
{/object}

* and it depend on config file.

date layout

{object}
0.12,PURCHASE_HEADER.DATE,date,12,12,Date,,
{default}today{/default}
{default}_today(){/default}
{default}_today('now'){/default} /*last date of last month*/
{default}_today('lol'){/default} /*last date of last month*/
{default}_today('fol'){/default} /*first date of last month*/
{default}_today('fom'){/default} /*first date of this month*/
{default}_today('d5'){/default} /*last 5 date*/
{default}_today('D5'){/default} /*next 5 date*/
{default}_today('y5'){/default} /* next 5 years */
{placeHolder}yyyy-mm-dd{/placeHolder}
{default}empty{/default}
{required}
{string}.substring(2,10){/string}
{inLineStyle}direction:rtl;{/inLineStyle}
format YYYY-MM-DD TO YY-MM-DD
{/object}



date difference
{onchange}
var d1 = new Date(this.value);
var d2 = new Date(userStrVariable0);
if(d2>d1){alert('New DNOte Date '+this.value+'cannot < the Old DNote Date '+userStrVariable0+' !!');this.value='';}
{/onchange}

date difference

{object}
1.361,DNOTE_LINE.EXPIRE_DATE,date:GRID,8%,150,Expire Date,,
{labelInLineStyle}font-style: italic;{/labelInLineStyle}
{tooltip}Maintenance Expire Date{/tooltip}
{onchange}
var sDateFrom=_lookup('DNOTE_LINE.ACTIVE_DATE'+thisRowNo);
var sDateTo=_lookup('DNOTE_LINE.EXPIRE_DATE'+thisRowNo);
var d1=parseDate(sDateFrom);
var d2=parseDate(sDateTo);
alert(DateDiff.inMonths(d1, d2));
/*e.g. DateDiff.inDays(d1, d2),DateDiff.inWeeks(d1, d2),DateDiff.inMonths(d1, d2),DateDiff.inYears(d1, d2)*/

{/onchange}

{/object}




_today()

function _today(){
var _today;
dateValue = new Date()
var M = "" + (dateValue.getMonth()+1);
var MM = "0" + M;
MM = MM.substring(MM.length-2, MM.length);
var D = "" + (dateValue.getDate());
var DD = "0" + D;
DD = DD.substring(DD.length-2, DD.length);
var YYYY = "" + (dateValue.getFullYear());
_today=YYYY+'-'+MM+'-'+DD;
return _today}
e.g.

{default}empty{/default}

{-----------------copy this code--------------------------------}


{refresh}
var s0723=_lookup('SALES_HEADER.INV_DATE');
if (s0723){
var oBeijing =parseDate(s0723);
var s0723a='10';
var oMyDate = dateCal(oBeijing,s0723a);
s0723=dtos(oMyDate,'yyyy-mm-dd');
if(s0723!='1899-12-31'){
_refreshv2('SALES_HEADER.DUE_DATE',s0723);}
}
{/refresh}

{-------------------------------------Lead Time --------------------------------------------------------}
{object}
0.679,SALES_ORDER_HEAD.LEADTIME,int,5,3,Committed Lead Time (Day),,
{numeric}
{alignRight}
{refresh}
var s0723=_lookup('SALES_ORDER_HEAD.ENTRY_DATE');
if (s0723){
/*var oBeijing = new Date(s0723);*/
var oBeijing =parseDate(s0723);
var s0723a=_lookup('SALES_ORDER_HEAD.LEADTIME');
var oMyDate = dateCal(oBeijing,s0723a);
s0723=dtos(oMyDate,'yyyy-mm-dd');
if(s0723!='1899-12-31'){
_refreshv2('SALES_ORDER_HEAD.REQUEST_SHIP_DATE',s0723);}
}
{/refresh}
{enableAutocomplete}
{tooltip}Please Input days.  (Calender day){/tooltip}
{/object}



{object}
0.67,SALES_ORDER_HEAD.ENTRY_DATE,date,9,10,Customer Order Rec. Date,,
{submitMust}
{default}{/default}
{tooltip}Customer Order Received Date{/tooltip}
{placeHolder}yyyy-mm-dd{/placeHolder}
{refresh}
var d1 = new Date(_lookup('this..CUSTOMER_PO_DATE'));
var d1add= dateCal(d1,4);
var d2 = new Date(_lookup('this.id'));
if (d2>d1add){$('.SALES_ORDER_HEAD_ENTRY_DATE').css('color', 'red');} else {$('.SALES_ORDER_HEAD_ENTRY_DATE').css('color', 'black');};
{/refresh}
{/object}



{object}
0.67,SALES_ORDER_HEAD.COMMITTED_COMPLETION_DATE,date,10,10,Actual Completion Date,,
{default}empty{/default}
{placeHolder}yyyy-mm-dd{/placeHolder}
{/object}


{default}  /  /  {/default}
{default}{/default} <- default today



2014年6月29日 星期日

generator-delete control delete-all





Delete all layout.txt

var s1113=document.getElementById('tableName1_111'); /*  currentTable */
var i=s1113.rows.length;
for (i1=0;i1<i;i1++) {
deleteRow('SALES_ORDER_PO_DESC',i1,'A');
}


Config.txt

masterKey=PURCHASE_ORDER
masterKey2=sales_code
deleteAction=withHeader


layout.txt

generator-referential
{referential}
SOURCE_TABLE=POBODY,
SOURCE_CODE=SALES_ORDER_PO_DESC_RECORDID,
SOURCE_NAME=PURCHASE_ORDER,
ERR_MESS=Have P.O.
{/referential}





{object}
0.12,PURCHASE_HEADER.PURCHASE_ORDER,text,10,10,Purchase Order,, {readonly}
{disabled}
{spaceLine}
 {refresh}DOCUMENT=($.trim(_lookup('this.id'))+'-'+$.trim(_lookup('PURCHASE_HEADER.VERSION'))).replace('-0',''); if (DOCUMENT==''){$("#printCaption0").css("disabled", "disabled" );}{/refresh}
{/object}




{object}
0.84,SALES_HEADER.DUE_DATE,date,20,20,Due Date,,
{placeHolder}yyyy-mm-dd{/placeHolder}
{required}
{requiredWhen}withHeaderReccount>0{/requiredWhen}
{/object}





{object}
0.26,SALES_HEADER.RATE,num.5,30%,20,Rate,,
{readonly}
{default}1{/default}
{currency}
{alignRight}
{invisibleWhen} PROCESSING_MODE=='D' | PROCESSING_MODE=='R' {/invisibleWhen}
{/object}












2014年5月29日 星期四

generator-labelOndblclick example

 {labelOndblclick} RetrievalStatus=0;currentChoose='';hadEdit=1; $('#popup-wrapper').width(800).height(500).css({top: -350, left: -100, position:'absolute'}); $('#moralFrame').prop('src','input.jsp?input=addressList.txt&config=addressListConfig.txt&mode=CHOICE'); $('#clicker').click();{/labelOndblclick}



{suffixLabel}Mths{/suffixLabel}


2014年5月26日 星期一

generator-messageBox


function saveMessage(p_saveAction, p_messageBoxCaption,p_code){
p_code=p_code?p_code:'';
saveAction=p_saveAction; messageBoxCaption=p_messageBoxCaption;
messageBoxPopup();$('#moralFrame').prop('src','input.jsp?mode=MINPUT&input=message.txt&config=messageConfig.txt&submitEvent='+p_code);
}



$('#popup-wrapper').width('400').height('200').css({top: -350, left: -100, position:'absolute'});
$('#moralFrame').prop('src','messageBox.jsp?message=Confirm Exit ?&boxType=2');
$('#clicker').click();}


16 = X
32 = ?
48 = exclamation
64 = information

_messagebox('Not Authorized !!',0,16);

_messagebox('You have unsaved changes that will be lost.',2,32,'Are you sure to cancel ?');

2014年5月13日 星期二

generator-readonly


PROCESSING_MODE=S [config.txt]

formReadOnly=_lookup('SUPPLIER_INVOICE_HEADER.STATUS')::'A'  [config.txt]

2014年4月30日 星期三

generator-autocomplete

0.20,CUSTOMER.NAME,autocomplete,100%:380px:400px,400,[NAME],,{autoComplete}TABLE_NAME.FIELD_NAME{/autoComplete}{noDuplicate}



{object}
0.20,VENDOR.NAME,autocomplete,100%:380px:400px,400,Supplier,,
{autoComplete}VENDOR.NAME{/autoComplete}{noDuplicate}
{placeHolder}Full Supplier Name for Cheque Issue{/placeHolder}
{/object}


{object}
0.20,PRODUCT.MANUFACTURER,autocomplete,100%:380px:400px,400,Manufacturer  ,,
{spaceLine}
{autoComplete}PRODUCT.MANUFACTURER{/autoComplete}
{onchange}
this.value=='N/A' ? _refreshv2('PRODUCT.MODEL','N/A'):_refreshv2('PRODUCT.MODEL','');
{/onchange}
{tooltips}Manufacturer{/tooltips}
{placeHolder}N/A for nouse{/placeHolder}
{/object}

{object}
0.22,PRODUCT.PRODUCT_LINE,autocomplete,100%:380px:400px,400,Product Line,,
{spaceLine}
{autoComplete}PRODUCT.PRODUCT_LINE{/autoComplete}
{tooltips}Manufacturer{/tooltips}
{placeHolder}N/A for nouse{/placeHolder}
{/object}




/**/
{object}
0.30,PRDTMSTR.MANUFACTURER,autocomplete,100%:380px:400px,400,Manufacturer  ,,
{spaceLine}{draftMust}
{autoComplete}PRDTMSTR.MANUFACTURER{/autoComplete}
{onchange}
this.value=='N/A' ? _refreshv2('PRDTMSTR.MODEL','N/A'):_refreshv2('PRDTMSTR.MODEL','');
{/onchange}
{tooltips}e.g. Microsoft{/tooltips}
{placeHolder}N/A for Not Applicable{/placeHolder}
{ondblclick}
if(PROCESSING_MODE=='D'){
this.value='N/A';_refreshv2('PRDTMSTR.MODEL','N/A');
}
{/ondblclick}
{onblur}
this.value=='N/A' ? _refreshv2('PRDTMSTR.MODEL','N/A'):_refreshv2('PRDTMSTR.MODEL','');
{/onblur}
{/object}

2014年4月24日 星期四

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月11日 星期五

generator-getvalue from a table



0.68,SALES_ORDER_HEAD.DELIVERY_LOCATION1,textarea,30,2,Delivery Address,,{colspan}2{/colspan}  {default}{/default} {labelOndblclick} RetrievalStatus=0;currentChoose='';hadEdit=1; $('#popup-wrapper').width(800).height(600);$('#moralFrame').prop('src','input.jsp?input=addressList.txt&config=addressListConfig.txt&mode=CHOICE'); $('#clicker').click();{/labelOndblclick}  {labelOndblclickAfter}} else if (currentID='this.id'){s= 'tableRead?'+'db=<%=DATABASE%>&'+ 'table=ADDRESS&'+'fields=recordid,address&'+'key=recordID&value='+formResult+'&format=S,S&'+'callback=?'; $.getJSON(s,function(data) {_refreshv2('this.id',data[0][1]);}){/labelOndblclickAfter} 

2014年4月6日 星期日

generator-textarea-memo



0.60,CUSTOMER.ADDRESS,textarea,30,4,[ADDRESS],,{default}{/default}{subformHeight}300{/subformHeight} 48 {subformWidth}500{/subformWidth}  47


{subformCaption}Serial Number{/subformCaption}

2014年4月2日 星期三

generator-numeric

1.361,SALES_LINE.AC_CODE,text:GRID,10%,10,AC CODE,,{numeric} {alignRight}


receipt.txt {refresh}_refreshv2('this.id',(_lookup('RECEIPT_HEADER.DOMAIN_AMOUNT').replace(/,/g,'')*1-_lookup('query.AMOUNT').replace(/,/g,'')*1).formatMoney(2, '.', ','));{/refresh}

0.890,query.diff,num.2,10,10,Difference&nbsp;&nbsp;&nbsp;,,{alignRight}

.

2014年3月26日 星期三

generator-style generator-valign generator-config


.
table style
0.61,PRODUCT_VIEW0.DESCRIPTION,text:GRID,27%,150,Description,,{inLineStyle}padding-left:2px;padding-right:2px;background:white;{/inLineStyle}


{labelInLineStyle}display:none;{/labelInLineStyle}
{labelInLineStyle}text-align:right;{/labelInLineStyle}
{labelInLineStyle}vertical-align:top;{/labelInLineStyle}

formHeaderTableProperties=cellspacing:'5'


productListOnly
FontSize=12px
LabelFontSize=13px
colWidth1=20
colWidth2=20
colWidth3=20
colWidth4=20
colWidth5=0
colWidth6=0
GridStyle=width:85%; margin:auto;,width:85%; margin:auto;
InputTextHeight=20px
GridRowHighLight=RGB(255,255,187) 
LabelFontSize=12px
EachLineHeight=4px
InputTextRadius=1px


GridHeight=140px
LABEL_WIDTH=100px   <= important
FontSize=12px
PageFrameHeight=300px
formHeaderTableLayout=fixed
PageBackGroundColor=#e1e1e1
FormWidth=90%
BodyTopMargin=45px
LineSpacing=3px.
LabelFontSize=12px
EachLineHeight=4px
InputTextRadius=1px
InputTextHeight=18px
Page3ColWidth=2,20,2,2      <= each page label and input format (have 10 page)


FocusBackGroundColor=#abcdef
GridRowHighLight=RGB(255,255,187)
GridStyle=width:85%; margin:auto;,width:85%; margin:auto;
ReadonlyCssStyle=color:black; background:#dddddd;

colWidth1=2
colWidth2=25
colWidth3=2
colWidth4=20
colWidth5=5
colWidth6=0
modalWidth=700  // the inside modal display box size  (default is full size)
modalHeight=500  // the inside modal display box size  (default is full size)




{subformHeight}{/subformHeight}
{subformWidth}{/subformWidth}





generator-data hidden / refresh

Combo Box Data
content.txt
0.41,SALES_HEADER.CUSTOMER,combo,15,15,Customer,,{colSpan}3{/colSpan}{getJson} tableRead?table=CUSTOMER&fields=RECORDID,NAME&where=where status:`A` &format=S,S&callback=?{/getJson}  {refresh}currentEntity=_lookup('this.id');{/refresh}

Display ShortForm Data
0.61,MANUFACTURER.STATUS,text:GRID,18%,150,Status,,{data}D,draft,A,approved,F,Frozen{/data}



Display the Form Read the Special Record

input.jsp?mode=SINPUT&input=products.txt&config=productsConfig.txt&key=recordid&keyValue=1390296450593

Display the Form Grid List
config.txt
where=where status:`D`  or status:`A`  or status:`F` 

Get data from another form
config.txt
appendData0=input.jsp?input:dNotesPurchaseList.txt&config:dNotesPurchaseListConfig.txt&mode:CHOICE
appendData0Caption=Createor 
appendData0Source=POQTYOS
appendData0TargetKey=DNOTE_LINE.PO_RECORDID
appendData0HeaderSource=SALES_ORDER,COMPANY,DIVISION,SALES_CODE,SUPPLIER,SHIP_TO_CONTACT,COMPANY_NAME,SHIP_TO_ADDRESS,OUR_REF_NO,CONTRACT_NO
appendData0HeaderSourceFormat=S,S,S,S,S,S,S,S,S,S
appendData0HeaderTarget=DNOTE_HEADER.SALES_ORDER,DNOTE_HEADER.COMPANY,DNOTE_HEADER.DIVISION, DNOTE_HEADER.SALES_CODE,DNOTE_HEADER.SUPPLIER,DNOTE_HEADER.SHIP_TO_CONTACT,DNOTE_HEADER.COMPANY_NAME,DNOTE_HEADER.SHIP_TO_ADDRESS,DNOTE_HEADER.OUR_REF_NO,DNOTE_HEADER.YOUR_REF_NO


Hidden Data
config.txt
InvisibleRetrivalNumber=1

Refresh Data
config.txt
Refresh=s:_lookup("PRODUCT_GROUP.STATUS");s:$.trim(s);if(s!:'A'){$("#submit3").css( "display", "none" );} else {$("#submit3").css( "display", "inline" );}
Display Grid List (Dyanamice input) 
config.txt
formConstrain=and (status:`D` or status:`A`  or status:`F`) 
queryMode=or
Content.txt
#
0.34,query.productsName,text,100%:200px:400px,40,KeyWord ,,{setConstrain}_c0=_lookup('query.productsName');{/setConstrain}{colspan}2{/colspan} {labelInLineStyle}word-wrap:normal;{/labelInLineStyle}
#
0.21,query.market,check,0,0,: Market,,{default}1{/default} {setConstrain}_c1=document.getElementById("query.market").checked;if(_c1){_c01='market like `^'+_c0+'^`';} else {_c01='false';} {/setConstrain} 
0.21,query.category,check,0,0, : Category,,{default}1{/default} {setConstrain}_c2=document.getElementById("query.category").checked;if(_c2){_c02='category like `^'+_c0+'^`';} else {_c02='false';} {/setConstrain} 
0.21,query.sub_cateory,check,0,0, : Sub-Category,,{default}1{/default} {setConstrain}_c3=document.getElementById("query.sub_cateory").checked;if(_c3){_c03='sub_category like `^'+_c0+'^`';} else {_c03='false';} {/setConstrain} 
0.24,query.manufacturer,check,0,0, : Manufacturer,,{default}1{/default} {setConstrain}_c4=document.getElementById("query.manufacturer").checked;if(_c4){_c04='manufacturer like `^'+_c0+'^`';} else {_c04='false';} {/setConstrain} 
0.24,query.model,check,0,0, : Model,,{default}1{/default} {setConstrain}_c5=document.getElementById("query.model").checked;if(_c5){_c05='model like `^'+_c0+'^`';} else {_c05='false';} {/setConstrain} 

0.24,query.description,check,0,0, : Description,,{default}1{/default} {setConstrain}_c6=document.getElementById("query.description").checked;if(_c6){_c06='description like `^'+_c0+'^`';} else {_c06='false';} {/setConstrain} 


Market 
Category Sub-Category 
Manufacturer 
Model Description