Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to multiple columns #38

Open
GoNode5 opened this issue May 7, 2015 · 2 comments
Open

how to multiple columns #38

GoNode5 opened this issue May 7, 2015 · 2 comments
Labels

Comments

@GoNode5
Copy link

GoNode5 commented May 7, 2015

I wonder this is possible with autoFields. I hope I make myself clear. THe blue line is the path for input when using TAB next field

gridedit2

@JustMaier
Copy link
Owner

This is an interesting problem. You might be able to do it with a Mutator as this is essentially another layout. Take a look at how bootstrap's Horizontal Layout was implemented. That should give you some ideas. If you're still at a loss, let me know what you've tried and I'll try to lend a hand.

@GoNode5
Copy link
Author

GoNode5 commented May 17, 2015

I tried something with no succes. When trying to force the next column the endresult gets a extra closing div making it useless:

    $autofieldsProvider.settings.columns = {
        formColumns: 2,
        currentColumn: 1,           
    };

    var rowCount=0
    function getRowCount() {
      return rowCount++;
    }
    function resetRowCount() {
      rowCount=0
    }



    $autofieldsProvider.registerMutator('columnsForm', function(directive, field, fieldElements){
        var currentRow=getRowCount();
        var htmlColumnGrid='<div class="col-sm-XX">'

        htmlColumnGrid=htmlColumnGrid.replace('XX',12/directive.options.columns.formColumns)


        if (currentRow===1) {
            directive.container.prepend(htmlColumnGrid)             
        };  
        //force new column for demo
        if (currentRow===4) {                       
          directive.container.append('</div>'+htmlColumnGrid)             
         resetRowCount();
        }
        return fieldElements;
    }, {require:'helpBlock'});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants