aurelia-v-grid / vGrid

Aurelia-v-grid - npm source
MIT License
49 stars 10 forks source link

Rebuild so you use html markup for most #10

Closed vegarringdal closed 8 years ago

vegarringdal commented 8 years ago

Rebuild so you use html markup for most

Something like this should be simple enough to make

<!--create the grid you want and pass in a "object in you component with keys ctx and   myGrid = {ctx:{},data:[]};--> 
<simple-grids class="center" style="position:absolute;top:0px;left:0;right:0;bottom:0" config="ctx.bind:myGrid">      
    <!--create row to display on each row and set row height-->                                                       
    <simple-grids-rows name="row" row-height="25" header-height="25">                                                  
        <simple-grids-column col-width="125" attibute="index"></simple-grids-column>                                  
        <simple-grids-column col-width="110" attibute="name"></simple-grids-column>                                   
        <simple-grids-column col-width="100" attibute="first"></simple-grids-column>                                  
        <simple-grids-column col-width="188" attibute="last"></simple-grids-column>                                   
        <simple-grids-column col-width="160" attibute="country"></simple-grids-column>                                
    </simple-grids-rows>                                                                                               
</simple-grids>                                                                                                       

could add for header and footer too, maybe use simple-grid-row-custom where you put in all the html your self like this: http://vegarringdal.github.io/aureliaGrid/00beta05/

the the grid context gets simple in js file

myGrid = {
    ctx:{},
    data : [],
    onRowClick:function(e, row){
      this.info="row click:"+row;
    }
  };
vegarringdal commented 8 years ago

rebuild done..