|
Hi here:I am collecting more features and ideas for new DJME 2 now. If you have some good ideas for DJME 2 please post here. Your ideas grows DJME2 !
Sharing my ideas and codes to make things change. |
DJME Development
Need to discuss about DNA jQuery Mvc Extensions library (DJME).
|
|
|
|
|
|
||||||
15 Ответы |
||||||
|
Previous thread:[jQuery Theme conflict with RadControl]
|
Next thread:[DJME2 beta2 released!]
|
#0 27.01.2011 20:02:46 |
|
Hi here:I am collecting more features and ideas for new DJME 2 now. If you have some good ideas for DJME 2 please post here. Your ideas grows DJME2 !
Sharing my ideas and codes to make things change. |
#1 10.05.2011 8:18:34 |
|
Hi, Ray:
It is strange that Grid only support Database Entities now. Can it support IEnumerable and others? |
#2 10.05.2011 10:21:17 |
|
That is no strange for Grid, You could bind any IEnumberable object to Grid. Please know that only you need the ModelBinder auto generate ObjectQuery (Sorting,Filtering,Paging) for your data object you must be used the Database Entities. Or you can rewrite the sorting,filtering ,paging logic by you self.for example:
1:
2: Ajax.Dna().Grid 3: .ShowScrollBar()
4: .Height(450)
5: ..
6: Render();
The membership user is not a database entities but we still could bind it to Grid. Sharing my ideas and codes to make things change. |
#3 11.05.2011 0:40:16 |
|
OK. I got it.I made a mistake. The demo:https://dotnetage.com/sites/home/djme-2-demo.html differs:
View(ModelBinder.BindForGrid(c =>c.CustomerID, db.Customers, _params)); so I found ModelBinder.BindForGird is for database entities.Would you offer a demo that no database entities instead of current one if possible? |
#4 11.05.2011 19:53:53 |
|
That's good idea, ok will add a no database demo for Grid.
Sharing my ideas and codes to make things change. |
#5 27.05.2011 0:19:28 |
|
Ray, I will continue to annoy you.
1. The DatePicker Control in DJME might not work currently. In my project it showes the error: Generic error \Create.cshtml(22): error CS0839: 缺少参数 I'm simply writing the code: Create.cshtml, @ is the line 22. 1:
2: <label for="StartDate">StartDatelabel> 3: @{
4: Ajax.Dna().DatePicker("StartDate")
5: .Value(DateTime.Now)
6: .Render();
7: }
2. In Accordin Control, I must write the code like this: 1:
2: @{DNA.Mvc.jQuery.AccordionBuilder ab = Ajax.Dna().Accordion("MatchCreate").Options(opt => { 3: opt.AutoHeight = false;
4: opt.Navigation = true;
5: }).Sections(sec => { 6: //Section contents
7: }
8: text>); 9: }).Width(400);
10: ab.Render();
11: }
If I wrote Ajax.Dna().Accordion("...").XXX().XXX().Render(); It can not be compiled. |
#6 27.05.2011 11:36:04 |
|
#1. I will follow this error.
#2. Could not complied means your web.config could not reference the DNA.Mvc.jQuery.dll so the asp.net could not find the helper method an add it to the AjaxHelper class. Sharing my ideas and codes to make things change. |
#7 29.05.2011 23:24:56 |
|
Hi, ray. I might make a mistake. After adding some assembly set to web.config, the two issues above are solved now.
And I have another question for Grid control about Server Binding and Client Binding. To my thought by far, Server Binding can only support ONE controller; and Client Biding can support multiple pages and multiple controller using .ClientBind(Url.Action("ClientBinding", "Grid")) ClientBinding and Grid means ClientBinding method of GridController. Thus in different pages, I can use any grid controls of different objects. (while Server Binding is short of this.) Is my thought right? |
#8 30.05.2011 8:31:08 |
|
I think i need to explain what are "Server binding" and "Client binding"
Server bindingMeans the Grid bind data and rendering the html result on server, actually the Grid is bing the Strong type objects and you could use any server methods in column template to control the output.It seems like "AutoPostBack" in ASP.NET FORM. Client bindingAs the label suggests, the Grid binding data and generate columns and rows on client site. The Action just only use to return JSON data to Grid. For SEO considering, i'd like to use ServerBinding on Internet, and use the ClientBinding on intranet. Whatever ServerBinding or ClientBinding they only request one url to server. Sharing my ideas and codes to make things change. |
#9 01.06.2011 4:45:45 |
|
其實我并不是不了解ServerBinding和ClientBinding的區別。
只是例如我有兩個Entities需要做Grid的時候,是不是只能使用ClientBinding?因為ServerBinding并沒有提供Controller的相關信息。(或者說只是GridController) 抱歉我使用中文了。和你的論壇格調不是很匹配。 -------------------------------------------------------------- I know the difference between ServerBinding and ClientBinding. Only I am wondering for instance two Entities binding to Grid. The only salution is ClientBiding, for ServerBinding did not provide Controller for the entities names. (or just think about GridController.) |
#10 01.06.2011 5:44:11 |
|
当然可以在一个View内使用两个Entities,可以通过ViewBag向视图传递实例就可以了
1:
2: ().Grid().Bind(ViewBag.Entity1).GetHtml()
3: ().Grid().Bind(ViewBag.Entity2).GetHtml()
Sharing my ideas and codes to make things change. |
#11 03.06.2011 5:48:14 |
|
那,相应的Controller怎么写呢?_______________________________________________________
Then what about the Controller? |
#12 04.06.2011 8:50:13 |
|
1:
2: public class MyController:Controller 3: {
4: public ActionResult GetDoubleModel() 5: {
6: ViewBag.Entity1=MyService.GetEntitres1();
7: ViewBag.Entity2=MyService.GetEntitres2();
8: return View(); 9: }
10: }
Sharing my ideas and codes to make things change. |
#13 04.06.2011 19:21:03 |
|
Ya! Great thought. \n\r
I will try this. \n\r That can be used in the condition of more Grids in one Page. Again, what to do if i use more Grid in different Pages? I still faint on the GridController.. For Instance, to show Entity1 in Entity1.cshtml and Entity2 in Entity2.cshtml using Grid. Then what about GridController? |
#14 05.06.2011 7:02:16 |
|
Please go to Grid demo page and view the source below demo.
Sharing my ideas and codes to make things change. |