EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 13, 2024, 03:17:22 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
How to give class name to datagrid column fields
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to give class name to datagrid column fields (Read 5695 times)
kush
Newbie
Posts: 29
How to give class name to datagrid column fields
«
on:
November 01, 2014, 04:25:51 AM »
I have a requirement of loading dynamic columns on click of a left arrow.For that i am looping over "table th" array with class name.And have given Class name to th fields from markup.
<th class="monthTd" field="jan 14" width="80">Jan 14</th>
<th class="monthTd" field="Feb 14" width="80">Feb 14</th>
<th class="monthTd" field="Mar 14" width="80">Mar 14</th>
<th class="monthTd" field="Apr 14" width="80">Apr 14</th>
<th class="monthTd" field="May 14" width="80">May 14</th>
<th class="monthTd" field="Jun 14" width="80">Jun 14</th>
<th class="monthTd" field="Jul 14" width="80">Jul 14</th>
<th class="monthTd" field="Aug 14" width="80">Aug 14</th>
<th class="monthTd" field="Sep 14" width="80">Sep 14</th>
<th class="monthTd" field="Oct 14" width="80">Oct 14</th>
<th class="monthTd" field="Nov 14" width="80">Nov 14</th>
<th class="monthTd" field="Dec 14" width="80">Dec 14</th>
$('th.monthTd').each(function(m) {} ----
Looping th array with class name
..
But the problem is on click of right arrow months will move to next months with columns.
for that i need to everytime call datagrid with modified columns array.
$('#dg').edatagrid({
columns:[new set of th fields],
});
For first time its dynamically changing column headers because the
.monthTd
is found in markup.
Next time when i filled dynamically from datagrid classname become empty.
So i want to set class name in my columns array.pls look into attachment nd do reply.
[ { title="Apr 2014", field="Apr 2014", width=80},{ title="Apr 2014", field="Apr 2014", width=80}]
Logged
kush
Newbie
Posts: 29
Re: How to give class name to datagrid column fields
«
Reply #1 on:
November 01, 2014, 09:00:48 PM »
Please let me know if i can give class name to columns fields from javascript.Becuase Jeasyui handling my markup tags to display none , and its tags dynamically to datagrid without my class name.
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: How to give class name to datagrid column fields
«
Reply #2 on:
November 02, 2014, 11:41:15 PM »
Why do you want to set a class name to the columns? To create datagrid with specified columns, just define the 'columns' property.
Code:
$('#dg').edatagrid({
columns:[[
{...}
]]
});
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...