Sherzod Posted September 15, 2014 Posted September 15, 2014 Hi! This is a masked input plugin for the jQuery javascript library. (Hayri Aslan more professionally implemented this feature: http://forums.unigui.com/index.php?/topic/4475-uniexclusive/) Source and usage: http://digitalbush.com/projects/masked-input-plugin/ Demo: http://digitalbush.com/projects/masked-input-plugin/#demo Simple example of use (eg with component UniEdit): 1. It is necessary to download the two files and include in your project 1. jquery 2. jquery.maskedinput.min.js 2. 1. UniEdit1.Text := ''; 2. UniEdit1 -> ClientEvents -> UniEvents -> add function beforeInit: function beforeInit(sender) { Ext.onReady( function () { $("#"+sender.id+"-inputEl").mask("99/99/9999"); }); } Best regards. 1 Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 hi, i can uniedit mask like this example. it is working. and i add unidbgrid column editor. but not working. thanks. Quote
Sherzod Posted September 16, 2014 Author Posted September 16, 2014 hi, i can uniedit mask like this example. it is working. and i add unidbgrid column editor. but not working. thanks. Hi Try: UniEdit1 -> ClientEvents -> ExtEvents -> add afterrender function: function afterrender(sender, eOpts) { $("#"+sender.id+"-inputEl").mask("aa***"); } function beforeInit(sender) { Ext.onReady( function () { $("#"+sender.id+"-inputEl").mask("99/99/9999"); }); } Best regards. Quote
chefdackel Posted September 16, 2014 Posted September 16, 2014 Hi! This is a masked input plugin for the jQuery javascript library. (Hayri Aslan more professionally implemented this feature: http://forums.unigui.com/index.php?/topic/4475-uniexclusive/) Source and usage: http://digitalbush.com/projects/masked-input-plugin/ Demo: http://digitalbush.com/projects/masked-input-plugin/#demo Simple example of use (eg with component UniEdit): 1. It is necessary to download the two files and include in your project 1. jquery 2. jquery.maskedinput.min.js 2. 1. UniEdit1.Text := ''; 2. UniEdit1 -> ClientEvents -> UniEvents -> add function beforeInit: function beforeInit(sender) { Ext.onReady( function () { $("#"+sender.id+"-inputEl").mask("99/99/9999"); }); } UniEditMask.png Best regards. great! As you are one of the JS-Gurus in this forum: how to not define the mask in the ClientEvents-properties (because the definitions are a bit hidden there for the developers), but in the Delphi-code, f.e. myform.create? Is this possible? Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 thanks delphi Developer. it is working. Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 hi, If left empty, the maskedit component fails Quote
Sherzod Posted September 16, 2014 Author Posted September 16, 2014 Hi, Sorry, actually this plugin is not oriented for DB components.But although it is possible to modify the code for the DB component.In your case,On which field you set? (what data type) Best regards. Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 my field datatype is "date" thanks Quote
Sherzod Posted September 16, 2014 Author Posted September 16, 2014 how to not define the mask in the ClientEvents-properties (because the definitions are a bit hidden there for the developers), but in the Delphi-code, f.e. myform.create? Is this possible? Hi chefdackel. If I understand you correctly, try: uses ... UniGUIApplication ... procedure TMainForm.UniFormCreate(Sender: TObject); begin UniSession.AddJS('Ext.onReady ( function () {$("#' + UniEdit1.JSName + '_id-inputEl").mask("aa**");});'); //OR UniEdit1.ClientEvents.ExtEvents.Add ('OnAfterrender=function OnAfterrender(sender, eOpts)'+ ' { $("#"+sender.id+"-inputEl").mask("aa**"); }'); end; Best regards. 1 Quote
Sherzod Posted September 16, 2014 Author Posted September 16, 2014 my field datatype is "date" thanks I will try... Have you tried using UniDateTimePicker1 with mask? UniDateTimePicker1 -> ClientEvents -> ExtEvents -> add afterrender function: function afterrender(sender, eOpts) { $("#"+sender.id+"-inputEl").mask("99/99/9999"); } Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 now , i try UniDateTimePicker1 and working . but i use UniDateTimePicker1 and i get long date Quote
Sherzod Posted September 16, 2014 Author Posted September 16, 2014 now , i try UniDateTimePicker1 and working . but i use UniDateTimePicker1 and i get long date ekran1.png UniDateTimePicker1.DateFormat := 'dd/MM/yyyy'; does not help? Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 my UniDateTimePicker1 date format is 'dd/MM/yyyy' but not working. and i write UniDateTimePicker1.DateFormat := 'dd/MM/yyyy'; again not working. i see long date. Quote
Administrators Farshad Mohajeri Posted September 16, 2014 Administrators Posted September 16, 2014 my UniDateTimePicker1 date format is 'dd/MM/yyyy' but not working. and i write again not working. i see long date. What is your uniGUI version? Quote
Sherzod Posted September 16, 2014 Author Posted September 16, 2014 my UniDateTimePicker1 date format is 'dd/MM/yyyy' but not working. and i write again not working. i see long date. without plugin is displayed correctly? Quote
mehmet07 Posted September 16, 2014 Posted September 16, 2014 column editor without correctly. but i add editor not displayed correctly. Quote
Administrators Farshad Mohajeri Posted September 16, 2014 Administrators Posted September 16, 2014 my unigui version is "0.93.0.996" It is a very old version. Many improvements are added since then. Please upgrade to latest build. Quote
rullomare Posted September 17, 2014 Posted September 17, 2014 Hi Delphi Developer, Thanks for Plugin. I wrote a very small component inherited from TuniEdit where I added a single Property "NumberFormat" and copying your code, I implemented AfterRender event. If leave blank the NumberFormat property, the component behaves exactly like TuniEdit. Problems with the component : The component, just as it is written, only works with the new version of Unigui (0.96,0.97). For older versions? , Booo. The solution of Delphi Developer, I believe also works with the old vesion of Unigui . Tested Only with Delphi XE3 MskEdit.zip Best Regards. 2 Quote
Sherzod Posted November 6, 2014 Author Posted November 6, 2014 how to clean uniDatetimePicker Hi, Which version are you using? The latest versions have a boolean property "clearButton". In previous versions, we could use this: http://forums.unigui.com/index.php?/topic/4179-help-to-program-an-own-component-based-on-tunidatetimepicker/ Best regards. Quote
CarlosJ Posted March 29, 2016 Posted March 29, 2016 Devo add estes arquivos no meu projeto como? de que tipo? Pretendo inserir máscara para CPF Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.