Jsajaxextjquerysturts common scripts

Source: Internet
Author: User
Extjsext import ticket import cookie create ExtstateManagerpublicstaticvoidmain (String [] args) {CalendarcalendarnewGregorianCalendar (); StringNcalendarget (CalendarYEAR) + & quot ;; str Extjsext import ticket import cookie create Ext. state. manager. public static void main (String [] args) {Calendar calendar = new GregorianCalendar (); String N = calendar. get (Calendar. YEAR) + ""; String Y = calendar. get (Calendar. MONTH) + 1 + ""; System. out. println (N + "" + Y); String D = calendar. get (Calendar. DAY_OF_WEEK) + "" ;}@ RemoteMethod managemeer @ Results ({@ Result (name = CRUDActionSupport. RELOAD, location = "complaints! Input. action? Id =$ {id} & updateFlag =$ {updateFlag} ", type =" redirect ")}) public class ComplaintsAction extends CRUDActionSupport {Trigger create or replace trigger tr_complaintsbeforeupdate or delete of column name on table name for eachdeclare beginif updating then if condition then execution statement end ifelsif deleting then update company c set c. erpmessage = 'delete' where c. CM_ID =: new. CM_ID; end if; exception when NO_DATA_FOUND THEN update company c set c. erpzt = 1, c. erpmessage = 'not found 'where c. CM_ID =: new. CM_ID; when others then update company c set c. erpzt = 1, c. erpmessage = 'exception' where c. CM_ID =: new. CM_ID; end TR_COMPANY; click Save to destroy sessionsession. removeValue ("contact"); // complaintsmanager when it is not confirmed to be added or changed. saveOrUpdate (complaints); // sqlburdenAssociateManager executed after the Department Information ticket is processed. deleteByGdid (complaints. getGdid (); the initial loading ticket type of the struts tag is assigned a static value. The value remains unchanged for the second time and is not cleared. Select multiple values and assign values // obtain the ticket type element var flag = document. getElementById ("type"); // you can change the value of the option from 0 to var index = flag. selectedIndex; // The value of the item eg 0 is all var val = flag. options [index]. value; document. getElementById ("cnt "). innerHTML = val + "Content abstract"; // hide $ ("# ssss "). hide (); display $ ("# ssss "). show (); remove multiple options $ ("# tsLevel "). empty (); js assigns a value to Multiple Static options $ ("# tsLevel "). append (" Minor error"); For attributes and styles // when you enter an existing phone number again, set the name of the contact behind it to gray $ (" # contact "). attr ("readolny", "readolny" ).css ({color: "red", background: "gray"}); $ ("# hyid "). removeAttr ("disabled" ).css ({color: "red", background: "white"}); js truncation character var khtypes = $. trim ($ ("# khlx "). val (); var khtyp = khtypes. substr (0, 3); $ ("# khlx "). focus (); // locate $ ("# hyid "). val (""); // clear $ ("# hyid, # telphoneNum, # contact "). val (""); asynchronously submit // ComplaintsManager. findByHyId (hyNum. value, showDataResult); function showDataResult (datainfo) {var khtypes = $. trim ($ ("# khlx "). val (); var khtyp = khtypes. substr (); if (null = datainfo) {if ("B2B" = khtyp | "B2B" = khtyp) {alert ("this distributor ID does not exist, enter "); $ (" # hyid, # telphoneNum, # contact "). val ("");} else if ("OTA" = khtypes) {alert ("This member user name does not exist, please enter it again"); $ ("# hyid, # telphoneNum, # contact "). val ("");} else if ("TMC" = khtypes) {alert ("This member number does not exist. Please enter it again"); $ ("# hyid, # telphoneNum, # contact "). val ("");} by default, dwr value is loaded for multiple options. -- Select --// The Source Information of the complaint information cascade function getTsFromDescribe (ts_describe) {var tsfrom = $ ("# t_tsfrom "). val (); var tstsFrom =$ ("# ts_tsFrom "). val (); Ext. ajax. request ({url: '$ {ctx}/complaints! GetTsFrom. action ', params: {tsfrom: tsfrom}, success: function (response) {var json = Ext. util. JSON. decode (response. responseText); if (json. success) {var data = json. cmList; if ("" = data) {alert ("select complaint type"); inputForm. t_tsfrom.focus (); $ ("# ts_tsFrom "). empty ();} else {$ ("# ts_tsFrom "). empty (); // Iteration for (var I = 0; I <data. length; I ++) {var id = data [I]; var name = data [I]; $ ("# ts_tsFrom "). append (" "+ Name +"");} Dwr. util. removeAllOptions ('tstsfrom '); dwr. util. addOptions ('tstsfrom ', data) ;}} order uniqueness // determine whether the order number has function checkDingdanId (userNameCnl) {ComplaintsManager. findByOrderId (userNameCnl. value, function (di) {// ("this order number already exists. Please enter it again or query the existing order details! ") If (di! = Null) {var r = confirm ("this order number already exists. Please enter it again or query the existing order details! "); If (r = true) {userNameCnl. value = ""; userNameCnl. focus ();} else {$ (". img "). show (); userNameCnl. focus () ;}// when loading the page, the ticket number is automatically generated $ (function () {function checkDingdanIds () {// DWR ComplaintsManager. getMaxData (function (di) {if (di! = Null) {$ ("# zdgdid"). val (di) ;}}) ;} checkbox End of month Close now Weekly close Half-month end time plug-in
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.