This is a migrated thread and some comments may be shown as answers.

RowTemplate that will look like two rows

1 Answer 1016 Views
Grid
This is a migrated thread and some comments may be shown as answers.
VasVas
Top achievements
Rank 1
VasVas asked on 05 Jun 2015, 01:12 PM

Dear Telerik,

I am faced with the fallowing problem, I want to create a row that contains the the tables column values and beneth them another row or what looks like a row but 

is not a new TR that contains , a summery/discription of his row.

I did start out with using a RowTemplate that contained to <tr> tags but that creates problems , the only one row is selected at a time and when the second row is selected only it's data is passed to the server. 

I found this post 

http://www.telerik.com/forums/multiple-line-template-displays-first-data-element-only that touches on the subject and on of the examples of code that does not work is on .

In my case all the data is displayed correctly but the fact that the RowTemplate contains two rows causes problems is there a way to create a false "row" only for presnetation inside one TR.

 

Yours,

 

Ariel

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 08 Jun 2015, 11:28 AM
Hello Ariel,

As you have noticed, adding two TR elements in the rowTemplate will break the internal logic of the control, which is more or less expected, because as the name states, this should be a template for a single row.

The only possible way for having such complex structure within the rowTemplate is to nest a TABLE element within a simple row with single TD element:
<script id="rowTemplate" type="text/x-kendo-tmpl">
  <tr data-uid="#: uid #">
    <td colspan="4">
      <table>
        <tr>
            <td class="photo">
                   <img src="../content/web/Employees/#:data.EmployeeID#.jpg" alt="#: data.EmployeeID #" />
            </td>
            <td class="details">
             <span class="name">#: FirstName# #: LastName# </span>
             <span class="title">Title: #: Title #</span>
            </td>
                <td class="country">
              #: Country #
            </td>
            <td class="employeeID">
               #: EmployeeID #
            </td>
         </tr>
         <tr>
           <td>test</td>
           <td>test</td>
           <td>test</td>
           <td>test</td>
         </tr>
     </table>
   </td>           
  </tr>
</script>

You can test the above approach in the following link:
Hope this helps.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
VasVas
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or