atatanasov / gijgo

Gijgo - Free Javascript Controls
http://gijgo.com
MIT License
475 stars 188 forks source link

Grid - detailTemplate - label #157

Open stvowi opened 7 years ago

stvowi commented 7 years ago

At the moment we can only show the content of a field via placeholder.

<table id="grid"></table>
 <script>
     $('#grid').grid({
         dataSource: '/Players/Get',
         uiLibrary: 'materialdesign',
         detailTemplate: '<div style="text-align: left"><b>Place Of Birth:</b> {PlaceOfBirth}</div>',
         columns: [ 
                { field: 'ID', width: 56 }, 
               { field: 'Name' }, 
              { field: 'DateOfBirth', title: 'Date Of Birth', type: 'date' },
               { field: 'PlaceOfBirth', title: 'Place Of Birth', detail: true}  
]
     });
 </script>

It would be nice to have a placeholder for "column.title" to show the label to the field. It make the i18n support for record labels easier.

Maybe so...

<div style="text-align: left"><b>{PlaceOfBirth:title}:</b> {PlaceOfBirth}</div>

or if title is not definied...

<div style="text-align: left"><b>{PlaceOfBirth:name}:</b> {PlaceOfBirth}</div>

It would be also great if the columneditor for a field would be shown at the place from the placeholder for the field value if the grid is in in inline editing mode. So we could edit a table row with much columns without dialog window.

stvowi commented 7 years ago

BTW, it could be than a nice lightweight replacement/alternative for x-editable or Editstrap

atatanasov commented 7 years ago

I will think about it. Thanks for the feedback.

stvowi commented 7 years ago

thanks