1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    7
    Answers
    1
    Vote Rating
    0
    imm.prabath is on a distinguished road

      0  

    Default Answered: How to read ASCIIMathML in sencha touch 2

    Answered: How to read ASCIIMathML in sencha touch 2


    I have a store with ASCIIMathML data and i want to preview it in view (using tpl tag). Can anybody did this before or any help?

    Thanx

  2. Finally I founded a answer to this problem. This is how i was configured the project.

    01). add these two files to ur project. (* to index.html file)

    <script type="text/javascript" src="myapp/js/ASCIIMathML.js"></script>
    <script type="text/javascript" src="myapp/js/mathjax/MathJax.js?config=MML_HTMLorMML-full"></script>

    02). after that use Ext.Loader.loadScriptFile() function in sencha.
    Ex.
    Ext.Loader.loadScriptFile( 'myapp/js/ASCIIMathML.js',function(){ generic()},this,false);
    Ext.Loader.loadScriptFile( 'myapp/js/mathjax/MathJax.js?config=MML_HTMLorMML-full',function(){ MathJax.Hub.Queue(["Typeset",MathJax.Hub]);},this,false);

    you need to call this two methods in onload function.

    03). actually these two files need to be called when u want to show equation. after display view you can call these two methods. It will show correct mathml equations in browser.

    Thats all
    Thanx

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,227
    Answers
    3523
    Vote Rating
    859
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What is the issue? Is the data in the store just fine?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    7
    Answers
    1
    Vote Rating
    0
    imm.prabath is on a distinguished road

      0  

    Default How to read ASCIIMathML in sencha touch 2

    How to read ASCIIMathML in sencha touch 2


    Hi,
    Glad for ur quick reply...


    I am developing Exam preparation application for iphone users.


    I put asciimathml data to my store and it has no problem of that data. Normally webkit browsers can read MathML format.
    I follwed this guide ('http://www.ltsn.gla.ac.uk/headocs/Gray_J.pdf') for simple example with html file and ASCIIMathML.js and it worked in safari and chrome browsers in iphone.


    This is the data i add to my store....(json string from the database)


    "QText":"Of the following, which is closest to ` (0.15 xx 495)\/9.97 ` ? ",
    "optionA":"7.5 ",
    "optionB":"15 ",
    "optionC":"75 ",
    "optionD":"150 ",
    "optionE":"750"


    This data are correctlly loaded and I will pass data to this view in my controller class {data:records.data}.I can view it in my Test view class...


    Code in Test view class...


    Ext.define('MyApp.view.Test',{
    extend:'Ext.Panel',

    config:{
    styleHtmlContent:true,
    scrollable:'vertical',
    fullscreen:true,
    tpl:'<div>{QText}<br><br>'+
    '<h5>A.</h5>{optionA}<br>'+
    '<h5>B.</h5>{optionB}<br>'+
    '<h5>C.</h5>{optionC}<br>'+
    '<h5>D.</h5>{optionD}<br>'+
    '<h5>E.</h5>{optionE}'+
    '</div>',
    }
    });


    This is the out put i got....


    Of the following, which is closest to ` (0.15 xx 495)\/9.97 ` ?


    A.7.5
    B.15
    C.75
    D.150
    E.750


    Actually I need to show my out put as attached image.

    how I accomplish this thing in sencha touch 2?

    Attached Images

  5. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    7
    Answers
    1
    Vote Rating
    0
    imm.prabath is on a distinguished road

      0  

    Default


    Any help
    Pleassss

  6. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    7
    Answers
    1
    Vote Rating
    0
    imm.prabath is on a distinguished road

      0  

    Default How to read ASCIIMathML in sencha touch 2

    How to read ASCIIMathML in sencha touch 2


    Finally I founded a answer to this problem. This is how i was configured the project.

    01). add these two files to ur project. (* to index.html file)

    <script type="text/javascript" src="myapp/js/ASCIIMathML.js"></script>
    <script type="text/javascript" src="myapp/js/mathjax/MathJax.js?config=MML_HTMLorMML-full"></script>

    02). after that use Ext.Loader.loadScriptFile() function in sencha.
    Ex.
    Ext.Loader.loadScriptFile( 'myapp/js/ASCIIMathML.js',function(){ generic()},this,false);
    Ext.Loader.loadScriptFile( 'myapp/js/mathjax/MathJax.js?config=MML_HTMLorMML-full',function(){ MathJax.Hub.Queue(["Typeset",MathJax.Hub]);},this,false);

    you need to call this two methods in onload function.

    03). actually these two files need to be called when u want to show equation. after display view you can call these two methods. It will show correct mathml equations in browser.

    Thats all
    Thanx

Thread Participants: 1