Open varshildoshi opened 6 years ago
Hi,
can you provide more information about your form (schema, data, layout)?
As a guess, you probably want this for a submit button :
"type": "submit", "style": "btn-info", "title" : "save", "onClick" : exampleOnSubmitFn($event)
yes,but i want to call my own method through submit button,but its not working..
i take one json for generate layout using typescript & angular 4,so if i create my own button for reset,submit,next & save,so need my own function for event,but in my json function is not work proprly...so give me solution..
i got the solution...
but one more thing, this is my birthdate json "birthdate" : { "type" : "date" }, this is my layout json for birthdate { "key" : "birthdate", "type" : "date", "flex" : "3 3 100px" }, but it gives me wrong data for date,ex: if i select 3/4/2003 it returns 2/4/2003,what can i do for that??
if i take type="string" & layout type="date" its not working..
& i use angular material design for that..
"but it gives me wrong data for date,ex: if i select 3/4/2003 it returns 2/4/2003,what can i do for that??"
What timezone are you using? it is related to #191 . The bug is not fixed but I wrote an override for my own project. Feel free to use it. datePickerOverride.zip I might submit a pull request to do things cleanly when I have the time.
In app.modules.ts :
{ provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
{ provide: MAT_DATE_FORMATS, useValue: MOMENT_DATE_FORMATS},
{ provide: DateAdapter, useClass : MomentDateAdapter }
and
export class AppModule {
constructor(wl: WidgetLibraryService) {
wl.registerWidget('date', NewMaterialDatepickerComponent);
}
}
Replace fr by your desired language The code was for my usage only, with Moments.js, and not fully tested, but I hope it helps
Btw, using your own function on Submit is done in the template's json-schema-form tag :
<json-schema-form framework="material-design" [layout]="layout" loadExternalAssets="false" [schema]="userScheme" [(ngModel)]="currentUser" (onSubmit)="submit($event)"></json-schema-form>
Note the (onSubmit) binding. The event Object contains your validated and submitted form.
i am not sure,so plz send me full code with output for datapicker.. plz...
and you can share related link for datepicker...for better understanding
Hi, Material Datepicker this is the documentation for Material Datepicker. Note the DateAdapter, which is not configurable in angular2-json-schema-form in its current state. After modifying your app.modules as above, the code in my previous comment is all you need to use the overriden class automatically, and the event in your submit function should contain the correct date (with your locale and the correct date for your timezone). You can keep your schema and layout as it is in this post .
Thanks..Alex130
one more thing..Alex130 I want to use tinymce in my project,so if u have any idea about it..plz tell me...in angular 4,angular material
Hi, it's not implemented yet, you would need to write your own widget, you can see the developer of the module writes about it in the future versions section on the main github page. If you do, please contribute to it if you can
ok..sure.. but do you know how to define & use my own css in json using angular material
I did a pull request about this a while ago : #221 Some attributes are already bound and you can use them, I added some of the missing ones, check it out.
hi Alex130 i want to help from you.. i want to create Drag & Drop in angular 4 using typescript,but some problem occures.. when i drop any text view generate text view in dropzone..it is using angular material.. if you know about that plz tell me..i am use jquery for drag & drop with angular material..so plz help me..
{ "type" : "button", "title" : "save", onClick : "exampleOnSubmitFn($event)" }
but does not work properly