English 中文(简体)
名单 观 jQueryMobile作体失去对其内容的更新
原标题:ListView jQueryMobile styles lost updating its contents

利用电话技术开发 我正在用当地数据库储存的数据,积极装上一份名单。 当我拯救新的环境信息并试图获得所有储存的环境时,名单文显示一切正确,但松散了 j的风格。

这是我html的相应部分:

<div data-role="page" data-theme="b" id="pageIndex">

    <div data-role="content" id="cntMain">
        New settings attribute
        <div id="nameDiv" data-role="fieldcontain">
            <label for="name" data-inline="true">Name</label>
            <input id="name" type="text"></input>
        </div>
        <div id="valueDiv" data-role="fieldcontain">
            <label for="value" data-inline="true">Value</label>
            <input id="value" type="text" ></input>
        </div>
        <a href="#" onclick="saveNewAttribute();" data-role="button">Save</a>
    </div> <!-- cntMain -->

    <div data-role="content" id="cntShow">
        Settings stored
        <ul id="settingsList" data-role="listview" data-filter="true" data-theme="b"></ul>
    </div> <!-- cntShow -->

</div>

called的功能是:

function saveNewAttribute() {
    name = $( #name ).val();
    value= $( #value ).val();

    try {
        ... // Validations, saving new attribute,...

        // Get settings information (executeDBQuery is just a shortcut function for performing the query)
        executeDBQuery( SELECT * FROM SETTINGS , function(tx, results) {
            var len = results.rows.length;
            console.info( readed   + len +   rows );
            var html =   ;
            for (var i=0; i<len; i++){
                var row = results.rows.item(i);
                html +=  <li data-theme="b"><a href="#" onclick="editAttribute(  + row.id +  )" data-transition="slide">  +
                         <h3>  + row.name +  </h3>  + 
                         <p><strong>  + row.value +  </strong></p></a></li> ;
            }
            console.info( Generated html=  + html);
            $( #settingsList ).html(html);
        });
    } catch (e) {
        alert( Error:   + e.message);
    }

    $( #cntMain ).hide();
    $( #cntShow ).show();
}

是否有任何人知道我怎样才能恢复这些 j的风格? 或者,是否有其他办法动态装上清单吗?

事先感谢你。

最佳回答

我找到了解决办法,如果有人感兴趣的话。 FCCC/SBI/2008/8。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签