English 中文(简体)
iphone child view inrows on a() statment in JS, appcelerator
原标题:iphone child view inside rows on a for() statment in JS, appcelerator

在学生能够看到班级时间表的监听器中,I m 制成一个“ iPhone”。

I have a JSON response where it brings me the classrooms with these attributes:

  • day
  • hour
  • class
  • professor

举例来说,这是一个具有类似意义的阵列:

[monday,8:00,math,sofia heelter]

[monday, 10biology,andrea sulivan]

[friday,8:00,math,sofia heelter]


我收到这些参数,并用本法典的<编码>可调频显示这些参数:

   for (var i = 0; i < response.classrooms.lenght; i++)
        {
        var day= response.classrooms[i].day;
        var hour= response.classrooms[i].hour;
        var materia= response.classrooms[i].class;
        var professor= response.classrooms[i].professor;

            var row = Titanium.UI.createTableViewRow({height: auto });
            var post_view = Titanium.UI.createView({
                height: auto , 
                layout: vertical ,
                top:5,
                right:5,
                bottom:5,
                left:5
            });
            var text= Titanium.UI.createLabel({
                text:text,

                top:0,
                left:0,
                bottom:15,
                height:48,
                width:300,
                font:{fontFamily: helvetica ,fontSize:20}
            });
            post_view.add(text);
            // Add the post view to the row
            row.add(post_view);
            // Give each row a class name
            row.className = "item"+i;
            // Add row to the rowData array
            rowData[i] = row;

        }

因此,问题是......

How can I assign to each class (I mean the university classroom that is shown above) which is in a row to have a child?

因此,当我点上两行时,我就把儿童的观点带上了他们的教室。 我关心教室,我只想把一名儿童分配给每一个牢房。

最佳回答

Firstly you should set hasChild property for the row view to show that row has child.

var row = Titanium.UI.createTableViewRow({height: auto ,hasChild:true});

然后,你可以打开一个新的window ,或 :view/a>,以显示数据细节,并应在问候活动中处理。

问题回答

这里有两点,首先,你不想有另一类人。 每一行各行各行各有相同名称。

 // Give each row a class name
 row.className = "studentRowClass";

第二,为了展示关于教室的具体信息,图瓦卢女同性恋、双性恋和变性者协会在上文提供的法典中看到任何课堂信息,你只是把它当作一种财产带给像这一样的囚室。

row.classRoomInfoURL = "class_one.js"

处理活动时

table.addEventListener( click , function(eventData) {
Ti.API.debug(eventData);
var win = Ti.UI.createWindow({
    title:"CLASS ROOM INFO",
    backgroundColor:  #fff ,
    width: 100% ,
    height: 100% ,
    url: eventData.rowData.classRoomInfoURL,
iii
win.open();

iii





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签