Pregunta

I would like to know how I can add jQuery plugin (https://github.com/thegrubbsian/jquery.ganttView) into the UIWebView as I want to display gantt chart with it?

Please tell me if there any tutorials or steps I should follow?

Thanks, Kanishka.

¿Fue útil?

Solución

Can have a .html file like -

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TITLE</title>

<script type="text/javascript" src="Plugin.js"></script>
<link type="text/css" href="Plugin.css" rel="stylesheet"/>    
</head>
<body>
<div id="Pluginwrapper">

<div id="Plugincontainer"></div>    
</div>
</body>
</html>

Have the .html file, .js file and .css(i.e. All the plugin files) file in the App bundle and, in order to display the content in UIWebView, just make the .html file and .js files as Bundle Resources in Xcode's Build Phases Tab.

Then use -

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"htmlfile" ofType:@"html"] isDirectory:NO]]];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top