generator-builder icon indicating copy to clipboard operation
generator-builder copied to clipboard

txtDbValue always hidden

Open thewebartisan7 opened this issue 5 years ago • 0 comments

There is a reason why the txtDbValue is always hidden?

This https://github.com/InfyOmLabs/generator-builder/blob/master/views/field-template.blade.php#L29

Should be appended to dbType like for htmlType and htmlValue

I can make a PR to:

  1. Make this field .txtDbValue always visible

  2. Add in form submit:

                // Append db value
                var dbType = $this.find('.txtdbType').val();
                // if not empty append
                if($this.find('.dbValue').val())  dbType = dbType + ':' + $this.find('.dbValue').val()

// ...

fieldArr.push({
                    name: $this.find('.txtFieldName').val(),
                    dbType: dbType, // here dbType
                    htmlType: htmlValue,
//...

And I would like to know about relation for each field as in your fields_sample.json there is for example:

    {
        "name": "writer_id",
        "dbType": "integer:unsigned:default,0:foreign,writers,id",
        "htmlType": "text",
        "relation": "mt1,Writer,writer_id,id"
    },

Right now seem not possible to add relation like this for each field, or am I missing something?

thewebartisan7 avatar Sep 01 '20 05:09 thewebartisan7