2012-04-13 3 views

답변

1

: 청문회에서 또는 귀하의 경우

public ActionResult Json() 
    { 
    json j = new json(); 

    j.timeline = new timeLine(); 
    j.timeline.headline = "TimeLine"; 
    j.timeline.type = "default"; 
    j.timeline.startDate = DateTime.Now.Year + "," + DateTime.Now.Month; 
    j.timeline.text = "<p>Time Line de todo el contenido.</p>"; 

    j.timeline.asset = new asset(); 
    j.timeline.asset.media = ""; 
    j.timeline.asset.credit = "Desarrollador por Mauricio Farias www.ald.cl    [email protected]"; 
    j.timeline.asset.caption = "Develop By Mauricio Farias"; 

    j.timeline.date = new List<date>(); 
    //for each de tiempos 
    for (int i = 0; i < 20; i++) 
    { 
     date d = new date(); 
     d.startDate = DateTime.Now.Year + "," + DateTime.Now.Month + "," + i; 
     d.endDate = DateTime.Now.Year + "," + DateTime.Now.Month + "," + (i + 1); 
     d.headline = "Headline date for date in timeline"; 
     d.text = "<p>text in date for date in timeline</p>"; 

     d.asset = new asset(); 
     d.asset.media = ""; 
     d.asset.credit = "credit in asset for date in timeline"; 
     d.asset.caption = "caption in asset for date in timeline"; 
     j.timeline.date.Add(d); 
    } 

     return Json(j, JsonRequestBehavior.AllowGet); 
    } 

는 영문 또는 HTML 페이지 (CSS를 넣어 기억)를 할 수있다 FAQ (네 번째 질문)에 명시된 바와 같이 :

TimelineJS에서 얼마나 많은 항목이 가장 효과적입니까?

타임 라인은 최대 100 개의 항목에 대해 최적화되어 있으며, 20-30 개의 항목이 더 적합합니다. 다른 것이 로딩 문제를 일으킬 수 있습니다.

어쩌면 당신은 한계를 존중하지 못할 수도 있지만 "많은 양의 데이터"를 사용하는 것이 좋은 경험이라고 생각하지 않습니다. :) (글쎄, 한 번에 100 개의 항목 만로드 할 수 있지만이 부분을 남겨 두겠습니다.)

나는 당신에게 대안을 제안 할 수 없습니다.

1

죄송합니다 .. 다시는 영어로 ....

베리 테 타임 라인 내가 MVC3 프로젝트 및 경로 컨트롤러에 데이터 소스를 가지고, 데이터 소스로 JSON을 지원합니다.

var timeline = new VMM.Timeline(); 
timeline.init("http://localhost:9306/TimeLine/Json"); 

당신에게 : 당신은 분명히

당신이 머리 또는 몸에 타임 라인 초기 스크립트를 넣어 일정을 시작하려면 .... 등 웹 서비스, 또는 리아에서 예를 들면 다르게 할 수있다

public class json 

{
공공 타임 라인 타임 라인 {: 데이터 구조를 저장하는 클래스를 생성, 이것은 당신이 드라이버에서 동일한 형식의 JSON에서 클래스의 인스턴스를 반환 할 수 있습니다얻을; 세트; } }

public class timeLine 
{ 
public string headline { get; set; } 
public string type { get; set; } 
public string startDate { get; set; } 
public string text { get; set; } 
public asset asset { get; set; } 
public List<date> date { get; set; } 
} 

public class asset 
{ 
public string media { get; set; } 
public string credit { get; set; } 
public string caption { get; set; } 
} 

public class date 
{ 
public string startDate { get; set; } 
public string endDate { get; set; } 
public string headline { get; set; } 
public string text { get; set; } 
public asset asset { get; set; } 
} 

컨트롤러 :

<div id="timeline"> 
</div> 
<script src="../../Content/assets/js/timeline-min.js"></script> 
<script src="../../Content/assets/js/script.js"></script> 
+0

안녕하세요, Mauricio! 대답은 Thnx입니다. 짧은 소개를 해주시면 기쁩니다. thies 타임 라인 툴이 엄청난 양의 데이터를 가지고 잘 작동한다면 내가 정말로 찾고 있었던 것이었다. 따라서이 도구와 많은 양의 데이터를 사용한다면 여전히 브라우저에서 제대로 스크롤됩니까? 아니면 시스템이 느려 집니까? thnx! – headkit

관련 문제