//Click the expanded eventfunctionExpandmorestr (v) {varStr= ""; if($ (v). Find (' i '). Hasclass (' icon-sort-up ')) ) {$ (v). Find (' I '). attr (' class ', ' Icon-sort-down ')); STR= $ (v). Prev (). attr (' Data-simple '); $ (v). Prev (). html (str); } Else{$ (v). Find (' I '). attr (' class ', ' icon-sort-up ')); $ (v). Prev (). attr (' Class ', ' text-no-ellipsis '); STR= $ (v). Prev (). attr (' Data-complete '); $ (v). Prev (). html (str); }}varCommonhelper ={selectpickerhelp:{//use of the Selectpicker controlInit:function(docid,tip) {//Enter the page, first initialize the controlDocId = "#" +docId; $ (docId). Selectpicker ({noneselectedtext:tip}); }, Building:function(param) {//initializing the control's data varDocId = "#" +Param.docid; if(NULL! = param.size && "undefined"! = param.size && ""! =$.trim (param.size)) {$ (docId). attr ("Data-size", param.size); } if(NULL! = param.multiple && "undefined"! = Param.multiple && ""! =$.trim (param.multiple)) {$ (docId). attr ("Multiple", param.multiple); } if(NULL! = Param.width && "undefined"! = Param.width && ""! =$.trim (param.width)) {$ (docId). attr ("Data-width", Param.width); } if(NULL! = Param.style && "undefined"! = Param.style && ""! =$.trim (Param.style)) {$ (docId). attr ("Data-style", Param.style); } varOptions = []; vardata =Param.dataParam.data; if(NULL!=param.dataParam.expendData) {Options.push (' <option value= ' +param.dataparam.expenddata[' val ']+ ' > ' +param.dataparam.expenddata[' name ']+ ' </option > '); } $.each (Data,function(i,e) {Options.push (' <option value= ' ' +e[param.dataparam.val]+ ' > ' +e[param.dataparam.name]+ ' </option> '); }); $ (docId). Prepend (Options.join (‘‘)); if(NULL! = Param.defaultval && "! = $.trim (param.defaultval) &&" undefined "! =param.defaultval) { if($ (docId). attr ("multiple") = = "multiple"){ varSelections = Param.defaultVal.split (","); $ (docId). Selectpicker (' Val ', selections); }Else{$ (docId). Selectpicker (' Val ', Param.defaultval); }} $ (docId). Selectpicker (' Refresh '); }, ReadValue:function(docId) {varDocId = "#" +docId; if($ (docId). attr ("multiple") = = "multiple"){ return$ (docId). Val (). Join (","); }Else{ return$ (docId). Val (); }}, longstrhelper:{simplifystr:function(data,max,style) {//String Collection Display vardiv = []; varSimpledata =data; if(NULL==data) { return""; } if(data.length>max) {Simpledata=data.substring (0,max) + "..."; } varDefaultStyle = "Table-layout:fixed;word-break:break-all;overflow:hidden;"; if(NULL! = Style && "undefined"! =style) { //filter the style type that repeats with the default style, leaving the default style startstyle = Style.replaceall ("\\s", "" "). ReplaceAll (" "," ");//Remove all spaces varStylearr = Style.split (";"); varDefaultkeys = ["Table-layout", "Word-break", "Overflow"]; for(varI =0;i<defaultkeys.length;i++){ varDFK =Defaultkeys[i]; if(Style.indexof (DFK) >-1) {alert (Defaultstyle.indexof (DFK)); Stylearr= $.grep (Stylearr,function(o,j) {if(O.indexof (DFK) <0){ returno; } }); } } //filter the style type that repeats with the default style, leaving the default style endstyle = DefaultStyle + Stylearr.join (";"); }Else{style=DefaultStyle; } Div.push (' <span data-complete= ' ' +data+ ' "data-simple=" ' +simpledata+ ' "style=" ' +style+ ' "> ' +simpledata+ ' </span> '); if(simpledata!=data) {Div.push (' <a class= ' Text-expand "href=" javascript:void (0); "onclick=" commonHelper.longStrHelper.expandStr (this); "style= "Float:right;" ><i class= "Icon-sort-down" ></i></a> '); } returnDiv.join (' '); }, Expandstr:function(v) {//expand or close a long string varStr= ""; if($ (v). Find (' i '). Hasclass (' icon-sort-up ')) ) {$ (v). Find (' I '). attr (' class ', ' Icon-sort-down ')); STR= $ (v). Prev (). attr (' Data-simple '); $ (v). Prev (). html (str); } Else{$ (v). Find (' I '). attr (' class ', ' icon-sort-up ')); $ (v). Prev (). attr (' Class ', ' text-no-ellipsis '); STR= $ (v). Prev (). attr (' Data-complete '); $ (v). Prev (). html (str); } } } }
Summarize the front-end common control and the solution of the incurable diseases