Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Questions about grid

$
0
0
Re: Questions about grid
FoxInCloud
Re: Questions about grid
Mar. 20, 2013
10:36 am
3QQ0MPXX9Show this entire thread in new window
Gratar Image based on email address
From:FoxInCloud support
To:Michele
OK Michele, thanks,
we'll take .inputMask into account and send you a patch by PM


For example in the column "Quantità" i have
Format = "Z"
InputMask = "999,999.999"

For column "Prezzo"
Format = ""
InputMask = "999,999.99"



What are the .Format and .InputMask of your columns?
? Set("DECIMALS")


Here is an example of the grid as it appears in browser

and in VFP

you can see that the format are different in decimal point..and also in number of decimals


Michele,

Please patch awHTML:
Replace awHTMLgen.getHTML_grd_AW_cScript_txt() with the following code:
Thanks

* ----------------------------------------------PROTECTEDFUNCTION getHTML_grd_AW_cScript_txt && Script de réglage d'un contrôle Textbox dans une colonneLPARAMETERS ; tcCol,; && N° de colonne en caractères toControl AS TextBox,; tcType,; && Type de .ControlSource tcFormat && .Format/.InputMaskthis.nDataSessionID = Set("Datasession")SETDATASESSIONTOthis.oForm.DataSessionID#IF NOT DEBUGMODETRY#ENDIF tcType = Evl(m.tcType, Type(m.toControl.ControlSource)) && fonctionne seulement dans la session de données du formulaire tcFormat = ;Evl(m.tcFormat; , Evl(Iif(lProperty(m.toControl.Parent, 'Format'), Evl(m.toControl.Format, m.toControl.Parent.Format), m.toControl.Format); , Iif(lProperty(m.toControl.Parent, 'InputMask'), Evl(m.toControl.InputMask, m.toControl.Parent.InputMask), m.toControl.InputMask); ); )LOCAL lcTimeZone, lnPoint, lcResultDOCASE&& le serveur et le client sont dans le même fuseau horaire CASE m.tcType == 'T' lcTimeZone = Int(GetTimeZone() * -60 * 10^3) && timezone offset in millisecondsTEXTTO m.lcResult TEXTMERGE NOSHOW FLAGS 1 PRETEXT m.this.nPretext var fmt = new AW.Formats.DateTimeVFP; fmt.setDataTimezone(); fmt.setTextTimezone(0); fmt.setDataFormat('ISO8601'); fmt.setTextFormat(''); setCellFormat(fmt, );ENDTEXTCASE m.tcType == 'D' OR 'D' $ m.tcFormatTEXTTO m.lcResult TEXTMERGE NOSHOW FLAGS 1 PRETEXT m.this.nPretext var fmt = new AW.Formats.DateVFP; fmt.setDataFormat('ISO8601'); fmt.setTextTimezone(0); fmt.setTextFormat(''); setCellFormat(fmt, );ENDTEXTCASE m.tcType == 'Y'TEXTTO m.lcResult TEXTMERGE NOSHOW FLAGS 1 PRETEXT m.this.nPretext var fmt = new AW.Formats.Number; fmt.setTextFormat(''); setCellFormat(fmt, );ENDTEXTCASE m.tcType == 'N'IFEmpty(m.tcFormat) tcFormat = Textmerge([fmt.setTextFormat('###');])ELSE tcFormat = Chrtran(m.tcFormat, "9", "#")IF NOT Set("Point") $ m.tcFormat lnPoint = Ratc('#', m.tcFormat) tcFormat = Iif(m.lnPoint > 0, Substr(m.tcFormat, 1, m.lnPoint) + '.' + Substr(m.tcFormat, m.lnPoint+1), m.tcFormat)ENDIF tcFormat = Iif(m.tcFormat == '$', this.getHTML_grd_AW_cScript_txt_cFmtY(), m.tcFormat) tcFormat = Textmerge([fmt.setTextFormat('');])ENDIFTEXTTO m.lcResult TEXTMERGE NOSHOW FLAGS 1 PRETEXT m.this.nPretext var fmt = new AW.Formats.Number; setCellFormat(fmt, );ENDTEXTOTHERWISE lcResult = Space(0)ENDCASE#IF NOT DEBUGMODECATCHTO loExceptionTHROW m.loException && renvoyé à this.getHTML()FINALLY* Revenir à la session de données initialeSETDATASESSIONTOthis.nDataSessionIDthis.nDataSessionID = 0ENDTRY#ELSE* Revenir à la session de données initialeSETDATASESSIONTOthis.nDataSessionIDthis.nDataSessionID = 0#ENDIFRETURN m.lcResult; + Iif(Empty(m.lcResult), '', CRLF)* ----------------------------------------------PROTECTEDFUNCTION getHTML_grd_AW_cScript_txt_cFmtY && format pour les nombres monétairesLOCAL lcResult lcResult = '#' + Chrtran(Set("Separator"), Chr(160), ' ') + '###' lcResult = m.lcResult + Iif(Set("Decimals") > 0; , Chrtran(Set('POINT'), Chr(160), ' ') + Replicate('#', Set("Decimals")); , ''; )IFSet("Currency") == 'RIGHT' lcResult = m.lcResult + Set("Currency", 1)ELSE lcResult = Set("Currency", 1) + m.lcResultENDIFRETURN m.lcResult


I have some problems while formatting the cell's content in a grid taht i have not when i use the same fields in the form.

I have a field (tot, currency type). In the grid a see it with the currency symbol ( "$" while i use "€") on the left and i see "," as separator and "," for decimals....while in my international settings i have "," for decimal and "." for separator).

Why ?







Thierry Nivelet (FoxInCloud)
Never explain, never complain (Queen Elizabeth II)


Viewing all articles
Browse latest Browse all 10393

Trending Articles